0.1.2-dev • Published 7 years ago
ischema-ts v0.1.2-dev
ischema
A TypeScript interface parser for generating JSON schemas.
Usage
Install for CLI: yarn global add ischema-ts | npm i ischema-ts -g
Run: ischema for current directory, or ischema path/to/directory/
Mark interfaces for transpilation by wrapping them with: /* SCHEMA */ and /* END SCHEMA */.
Example:
/* SCHEMA */
interface ITest {
[key: string]: any;
}
/* END SCHEMA */Options
Create an ischema.json file in the root you will be running ischema in.
{
"options": {
"rootDir": ".",
"outDir": "./schemas"
}
}Use ischema --init or ischema --init path/to/folder to create this file for you.
Known Issues
- Issues parsing function types properly.
- Does not conform types to JSON strict types (yet).