Skip to content

wendbv/sontyp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sontyp

Travis Coveralls

Sontyp is a somewhat advanced converter, converting from json-schema to Typescript.

Specific to Sontyp

JSON Schema by itself isn't very strict, and thus in a lot of cases, Sontyp will have to make a bunch of assumptions. If, instead, you validate your schemas against our more strict schema definition, the returned definitions will be a lot more predictable and reliable.

Usage

var sontyp = require('sontyp');

// Simple example: we'll read our schemas from the ./schemas/ directory, and
// save them to a file schemas.d.ts
const fs = require('fs');
let obj = JSON.parse(fs.readFileSync('schemas/entry.json'));

// Pass it along to sontyp
let dts = sontyp.sontyp(obj, 'schemas/');

// Write whatever we got to a .d.ts file
fs.writeFileSync('schemas.d.ts', dts);

About

A JSON Schema to .d.ts converter.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors