Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`