Skip to content

aspect-forks/json-dts-generator

 
 

Repository files navigation

json-to-dts

Generate TS declaration files from JSON files. Suitable for both small and large datasets.

Usage

Install it globally:

$ npm i -g json-dts-generator
$ json-dts-generator <input_json> <output_dts>

Or use npx:

$ npx json-dts-generator <input_json> <output_dts>

Purpose

Reads the input json file, parses each into a TS declarations and outputs a dts file.

Pitfalls

  • Cannot infer proper types for empty arrays. The script will warn you if it runs into any of these so that you can fix them manually.

About

Generate TS declaration file from JSON file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 79.9%
  • JavaScript 20.1%