jx 1.0.5 copy "jx: ^1.0.5" to clipboard
jx: ^1.0.5 copied to clipboard

The dart jx parser. jx is a super-set of JSON that supports core JSON but adds many more powerful features, like comments, variables, functions and more.

A parser for jx files (extended JSON format).

Features #

jx (short for JSON eXtended, file extension .jx) is a file format that extends JSON. jx was designed specifically for configuration files, but has a wide range of potential applications. jx is a super-set of JSON that supports core JSON but adds many more powerful features. For example:

  • Inline and block comments
  • Keys without quotes
  • Single and double quoted strings
  • Equations
  • Variables, functions and user-defined functions
  • String, Array and Object operations (combine, add, remove etc)
  • Color support and manipulation

Example jx file

Overview of the jx specification

Getting started #

  • Add jx to your pubspec.yaml

Usage #

import 'package:jx/jx.dart';

void main() {
  String jx = '''{
    // This is an example jx file
    \$code: 'jx';
    name: code + ' file format (.' + code + ')';
  }''';
  var parser = JxParser();
  var result = parser.parse(jx);

  print(result['name']); // jx file format (.jx)
  print(result.variables['code']); // jx
}
0
likes
140
pub points
0%
popularity

Publisher

unverified uploader

The dart jx parser. jx is a super-set of JSON that supports core JSON but adds many more powerful features, like comments, variables, functions and more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on jx