json5 0.8.2 copy "json5: ^0.8.2" to clipboard
json5: ^0.8.2 copied to clipboard

A lightweight library for encoding and decoding JSON5 with comments and trailing commas support.

example/main.dart

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);
}
18
likes
150
pub points
87%
popularity

Publisher

unverified uploader

A lightweight library for encoding and decoding JSON5 with comments and trailing commas support.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on json5