{"id":15734009,"url":"https://github.com/eemeli/json-estree-ast","last_synced_at":"2025-06-23T01:08:37.936Z","repository":{"id":54783349,"uuid":"125515508","full_name":"eemeli/json-estree-ast","owner":"eemeli","description":"ESTree-compatible JSON AST parser","archived":false,"fork":false,"pushed_at":"2021-01-29T16:13:36.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T00:03:59.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/json-estree-ast","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eemeli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-16T12:47:17.000Z","updated_at":"2022-01-09T16:34:20.000Z","dependencies_parsed_at":"2022-08-14T02:51:18.977Z","dependency_job_id":null,"html_url":"https://github.com/eemeli/json-estree-ast","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/eemeli/json-estree-ast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eemeli%2Fjson-estree-ast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eemeli%2Fjson-estree-ast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eemeli%2Fjson-estree-ast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eemeli%2Fjson-estree-ast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eemeli","download_url":"https://codeload.github.com/eemeli/json-estree-ast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eemeli%2Fjson-estree-ast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261392179,"owners_count":23151718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T01:00:48.589Z","updated_at":"2025-06-23T01:08:32.916Z","avatar_url":"https://github.com/eemeli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESTree-compatible JSON AST parser\n\nA small wrapper around [json-to-ast] that translates its output to the [ESTree Spec], which makes it usable for example as a [jscodeshift] parser.\n\n[json-to-ast]: https://www.npmjs.com/package/json-to-ast\n[ESTree Spec]: https://github.com/estree/estree\n[jscodeshift]: https://www.npmjs.com/package/jscodeshift\n\n## Installation\n```\nnpm install json-estree-ast\n```\n\n## Usage\n\n```js\nconst { parse } = require('json-estree-ast');\n\nconst options = {\n  loc: true,  // include source location information. Default `true`\n  source: 'data.json'  // include source information. Default `null`\n};\n\nparse('{\"a\": 1}', options);\n```\n\nOutput\n```js\n{\n  type: 'Program',\n  body: [\n    {\n      type: 'ObjectExpression',\n      properties: [\n        {\n          type: 'Property',\n          key: {\n            type: 'Identifier',\n            name: 'a',\n            raw: '\"a\"',\n            loc: {\n              start: { line: 1, column: 1 },\n              end: { line: 1, column: 4 },\n              source: 'data.json'\n            }\n          },\n          kind: 'init',\n          value: {\n            type: 'Literal',\n            value: 1,\n            raw: '1',\n            loc: {\n              start: { line: 1, column: 6 },\n              end: { line: 1, column: 7 },\n              source: 'data.json'\n            }\n          },\n          loc: {\n            start: { line: 1, column: 1 },\n            end: { line: 1, column: 7 },\n            source: 'data.json'\n          }\n        }\n      ],\n      loc: {\n        start: { line: 1, column: 0 },\n        end: { line: 1, column: 8 },\n        source: 'data.json'\n      }\n    }\n  ],\n  loc: {\n    start: { line: 1, column: 0 },\n    end: { line: 1, column: 8 },\n    source: 'data.json'\n  }\n}\n```\n\n## Node types\n\n#### ObjectExpression\n```js\n{\n  type: 'ObjectExpression',\n  properties: Property[],\n  loc?: SourceLocation\n}\n```\n\n#### Property\n```js\n{\n  type: 'Property',\n  key: Identifier,\n  kind: 'init',\n  value: ObjectExpression | ArrayExpression | Literal,\n  loc?: SourceLocation\n}\n```\n\n#### Identifier\n```js\n{\n  type: 'Identifier',\n  name: string,\n  raw: string,\n  loc?: SourceLocation\n}\n```\n\n#### ArrayExpression\n```js\n{\n  type: 'ArrayExpression',\n  children: (ObjectExpression | ArrayExpression | Literal)[],\n  loc?: SourceLocation\n}\n```\n\n#### Literal\n```js\n{\n  type: 'Literal',\n  value: string | number | boolean | null,\n  raw: string,\n  loc?: SourceLocation\n}\n```\n\n#### SourceLocation\n```js\n{\n  source?: string,\n  start: SourcePosition,\n  end: SourcePosition\n}\n```\n\n#### SourcePosition\n```js\n{\n  line: number,\n  column: number\n}\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feemeli%2Fjson-estree-ast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feemeli%2Fjson-estree-ast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feemeli%2Fjson-estree-ast/lists"}