{"id":18901043,"url":"https://github.com/leaves4j/node-thrift-parser","last_synced_at":"2025-06-13T19:36:43.396Z","repository":{"id":78104248,"uuid":"108708501","full_name":"leaves4j/node-thrift-parser","owner":"leaves4j","description":"Parse thrift IDL to an AST","archived":false,"fork":false,"pushed_at":"2017-11-22T08:50:01.000Z","size":164,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T20:14:47.340Z","etag":null,"topics":["javascript","parser","thrift"],"latest_commit_sha":null,"homepage":"","language":"Thrift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leaves4j.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-29T05:43:46.000Z","updated_at":"2021-02-04T12:43:37.000Z","dependencies_parsed_at":"2023-03-12T03:33:50.140Z","dependency_job_id":null,"html_url":"https://github.com/leaves4j/node-thrift-parser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/leaves4j/node-thrift-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leaves4j%2Fnode-thrift-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leaves4j%2Fnode-thrift-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leaves4j%2Fnode-thrift-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leaves4j%2Fnode-thrift-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leaves4j","download_url":"https://codeload.github.com/leaves4j/node-thrift-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leaves4j%2Fnode-thrift-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259708025,"owners_count":22899531,"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":["javascript","parser","thrift"],"created_at":"2024-11-08T08:54:55.276Z","updated_at":"2025-06-13T19:36:43.385Z","avatar_url":"https://github.com/leaves4j.png","language":"Thrift","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-thrift-parser\n---\nParse thrift IDL to an AST\n\n## Installation\n\n```bash\nnpm install node-thrift-parser -S\n```\n\n## Example\n\n```js\nconst parser = require('node-thrift-parser');\nconst ast = parser(`\n/**\n * test\n */\n\ninclude 'test.thrift'\nnamespace * thrift.test\n\nenum Numberz {\n  ONE = 1,\n  TWO\n}\n\ntypedef i64 UserId;\n\nstruct Bonk {\n  1: string message,\n  2: i32 type\n}\n\nexception Xception {\n  1: i32 errorCode,\n  2: string message\n}\n\nservice ThriftTest {\n  void testVoid(),\n  string testString(1: string thing) throws (1: Xception e),\n}\n`);\n\n```\n result\n\n```json\n{\n   \"headers\": [\n      {\n         \"type\": \"include\",\n         \"path\": \"'test.thrift'\"\n      },\n      {\n         \"type\": \"namespace\",\n         \"namespaceScope\": \"*\",\n         \"identifier\": \"thrift.test\"\n      }\n   ],\n   \"definitions\": [\n      {\n         \"type\": \"enum\",\n         \"identifier\": \"Numberz\",\n         \"enumFields\": [\n            {\n               \"type\": \"enumField\",\n               \"identifier\": \"ONE\",\n               \"value\": \"1\"\n            },\n            {\n               \"type\": \"enumField\",\n               \"identifier\": \"TWO\",\n               \"value\": null\n            }\n         ]\n      },\n      {\n         \"type\": \"typedef\",\n         \"definitionType\": \"i64\",\n         \"identifier\": \"UserId\"\n      },\n      {\n         \"type\": \"struct\",\n         \"identifier\": \"Bonk\",\n         \"fields\": [\n            {\n               \"id\": \"1\",\n               \"option\": null,\n               \"fieldType\": \"string\",\n               \"identifier\": \"message\",\n               \"defaultValue\": null\n            },\n            {\n               \"id\": \"2\",\n               \"option\": null,\n               \"fieldType\": \"i32\",\n               \"identifier\": \"type\",\n               \"defaultValue\": null\n            }\n         ]\n      },\n      {\n         \"type\": \"exception\",\n         \"identifier\": \"Xception\",\n         \"fields\": [\n            {\n               \"id\": \"1\",\n               \"option\": null,\n               \"fieldType\": \"i32\",\n               \"identifier\": \"errorCode\",\n               \"defaultValue\": null\n            },\n            {\n               \"id\": \"2\",\n               \"option\": null,\n               \"fieldType\": \"string\",\n               \"identifier\": \"message\",\n               \"defaultValue\": null\n            }\n         ]\n      },\n      {\n         \"type\": \"service\",\n         \"identifier\": \"ThriftTest\",\n         \"extendIdentifier\": null,\n         \"functions\": [\n            {\n               \"type\": \"function\",\n               \"functionType\": \"void\",\n               \"identifier\": \"testVoid\",\n               \"oneway\": null,\n               \"args\": [],\n               \"throws\": null\n            },\n            {\n               \"type\": \"function\",\n               \"functionType\": \"string\",\n               \"identifier\": \"testString\",\n               \"oneway\": null,\n               \"args\": [\n                  {\n                     \"id\": \"1\",\n                     \"option\": null,\n                     \"fieldType\": \"string\",\n                     \"identifier\": \"thing\",\n                     \"defaultValue\": null\n                  }\n               ],\n               \"throws\": [\n                  {\n                     \"id\": \"1\",\n                     \"option\": null,\n                     \"fieldType\": \"Xception\",\n                     \"identifier\": \"e\",\n                     \"defaultValue\": null\n                  }\n               ]\n            }\n         ]\n      }\n   ]\n}\n\n```\n## ChangeLog\n\n[ChangeLog](./CHANGELOG.md)\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleaves4j%2Fnode-thrift-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleaves4j%2Fnode-thrift-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleaves4j%2Fnode-thrift-parser/lists"}