Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nstseek/json-to-ts
This is a small executable nodejs script that generates TS types from a JSON file
https://github.com/nstseek/json-to-ts
Last synced: about 2 months ago
JSON representation
This is a small executable nodejs script that generates TS types from a JSON file
- Host: GitHub
- URL: https://github.com/nstseek/json-to-ts
- Owner: nstseek
- Created: 2024-02-14T07:46:49.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-14T08:06:59.000Z (11 months ago)
- Last Synced: 2024-03-15T09:08:01.732Z (10 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-to-ts
This is a simple Nodejs script that generates TS types based on a JSON file
## Usage Example
`node index.js {json_file_path} > {output_file_path}`
This will produce a file with the name you provided containing the generated TS types
A full usage (you can run using the example.json file provided in the repo) would look like this
`node index.js ./example.json > type.ts`
This would produce a file called `type.ts` with generated TS types based on the `example.json` file provided
## NPM binary
This can also be used as a NPM binary under the `json-to-ts` name
The usage would look like this
`json-to-ts {json_file_path} > {output_file_path}`
or
`json-to-ts ./example.json > type.ts`