2.3.1 • Published 3 years ago
runtypes-generator v2.3.1
runtypes-generator
Generate runtypes from static types & JSON schema.
Instructions
Install
npm install runtypes
npm install -D runtypes-generator
Configure
# runtypes.gen.yml
# This config represents a list of files to create.
- targetFile: src/runtypes.ts # The file to create
sourceTypes:
- file: src/types.ts # The file where your type lives
type: Foo # The type you want to convert to a runtype
- file: json/my-json-schema.json # You can even use JSON schema files!!
type: ExampleType
Run
npx rungen