Skip to content

winglang/dts-reader

Repository files navigation

dts-reader

Reads a TypeScript type definition file and generates a JSON representation of the API.

STATUS: this is a prototype, and not fully implemented. This means that there might be modules that cannot be read and type information that might not be included in the output.

We should look into https://ts-morph.com/ as an alternative way to read typescript definitions.

Usage

Clone the repo:

git clone git@github.com:winglang/dts-reader.git
cd dts-reader

Build:

npm install
npm run build

Run:

bin/dts-reader node_modules/@types/json-schema/index.d.ts
.output/json-schema.types.json

The file .output/json-schema.types.json now includes a JSON representation of the types exported by the json-schema module.

Contributing

All contributions are celebrated. We follow the CNCF Code of Conduct.

We hang out on Wing Slack.

License

Licensed under the MIT License.