vtrushin / Json To Ast
Licence: mit
JSON AST parser
Stars: β 161
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Json To Ast
Metric Parser
π AST-based advanced mathematical parser written by Typescript.
Stars: β 26 (-83.85%)
Mutual labels: ast, tree, parser
Bad json parsers
Exposing problems in json parsers of several programming languages.
Stars: β 351 (+118.01%)
Mutual labels: json, parser, json-parser
Go
A high-performance 100% compatible drop-in replacement of "encoding/json"
Stars: β 10,248 (+6265.22%)
Mutual labels: json, parser, json-parser
Jsonparser
One of the fastest alternative JSON parser for Go that does not require schema
Stars: β 4,323 (+2585.09%)
Mutual labels: json, parser, json-parser
Xml Js
Converter utility between XML text and Javascript object / JSON text.
Stars: β 874 (+442.86%)
Mutual labels: json, parser, json-parser
Parson
Lightweight JSON library written in C.
Stars: β 965 (+499.38%)
Mutual labels: json, parser, json-parser
Java
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
Stars: β 1,308 (+712.42%)
Mutual labels: json, parser, json-parser
Object Visualizer
Vue JSON inspector with Chrome-like theme.
Stars: β 159 (-1.24%)
Mutual labels: tree, json
Django Jsoneditor
Django JSONEditor input widget to provide javascript online JSON Editor
Stars: β 124 (-22.98%)
Mutual labels: tree, json
Tiny Json
The tiny-json is a versatile and easy to use json parser in C suitable for embedded systems. It is fast, robust and portable.
Stars: β 127 (-21.12%)
Mutual labels: json, parser
Alembic
βοΈ Functional JSON Parser - Linux Ready π§
Stars: β 115 (-28.57%)
Mutual labels: json, parser
Dynamodb Json
DynamoDB json util to load and dump strings of Dynamodb json format to python object and vise-versa
Stars: β 114 (-29.19%)
Mutual labels: json, json-parser
Json Autotype
Automatic Haskell type inference from JSON input
Stars: β 139 (-13.66%)
Mutual labels: json, parser
Prettier
Prettier is an opinionated code formatter.
Stars: β 41,411 (+25621.12%)
Mutual labels: ast, json
Babylon
PSA: moved into babel/babel as @babel/parser -->
Stars: β 1,692 (+950.93%)
Mutual labels: ast, parser
Spotify Json
Fast and nice to use C++ JSON library.
Stars: β 145 (-9.94%)
Mutual labels: json, json-parser
Gelatin
Transform text files to XML, JSON, or YAML
Stars: β 150 (-6.83%)
Mutual labels: json, parser
JSON AST parser
Install
> npm install json-to-ast
Usage
const parse = require('json-to-ast');
const settings = {
// Appends location information. Default is <true>
loc: true,
// Appends source information to nodeβs location. Default is <null>
source: 'data.json'
};
parse('{"a": 1}', settings);
Output
{
type: 'Object',
children: [
{
type: 'Property',
key: {
type: 'Identifier',
value: 'a',
raw: '"a"',
loc: {
start: { line: 1, column: 2, offset: 1 },
end: { line: 1, column: 5, offset: 4 },
source: 'data.json'
}
},
value: {
type: 'Literal',
value: 1,
raw: '1',
loc: {
start: { line: 1, column: 7, offset: 6 },
end: { line: 1, column: 8, offset: 7 },
source: 'data.json'
}
},
loc: {
start: { line: 1, column: 2, offset: 1 },
end: { line: 1, column: 8, offset: 7 },
source: 'data.json'
}
}
],
loc: {
start: { line: 1, column: 1, offset: 0 },
end: { line: 1, column: 9, offset: 8 },
source: 'data.json'
}
}
Node types
Object:
{
type: 'Object',
children: <Property>[],
loc?: Object
}
Property:
{
type: 'Property',
key: <Identifier>,
value: Object | Array | <Literal>,
loc?: Object
}
Identifier:
{
type: 'Identifier',
value: string,
raw: string,
loc?: Object
}
Array:
{
type: 'Array',
children: (Object | Array | <Literal>)[],
loc?: Object
}
Literal:
{
type: 'Literal',
value: string | number | boolean | null,
raw: string,
loc?: Object
}
AST explorer
Try it online on astexplorer.net
License
MIT
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].