jx 1.0.5
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
Getting started #
- Add
jx
to yourpubspec.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
}