npm.io
0.1.2-dev • Published 7 years agoCLI

ischema-ts

Licence
MIT
Version
0.1.2-dev
Deps
2
Size
45 kB
Vulns
0
Weekly
0

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).