json5

Last updated:

0 purchases

json5 Image
json5 Images
Add to Cart

Description:

json5

JSON5 for dart and flutter #

This dart-package is a ported version of json5 which is written in pure javascript.
We use the same algorithms, so we have the same behaviors, the same specification.
But dart have different name convention, see the code below.
Usage #
import 'package:json5/json5.dart';

void main() {
var obj = JSON5.parse('{ '
' /* comment block */ '
' name: {first: "phat"}, '
' lang: ["C++", "dart", "kotlin"], '
' nums: [NaN, Infinity, -Infinity] '
'} // end object ');

var compact = JSON5.stringify(obj);

print(compact);

var pretty = JSON5.stringify(obj, space: 2);

print(pretty);
}
copied to clipboard
Current limitations #

Only serialize classes which implement List and Map

References #

json5
json5 in javascript

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.