Generates TypeScript interfaces from a JSON object
- Node 10+
- Zero Dependencies
npm install json-tell
yarn add json-tell
import {getTypes} from 'json-tell';
const options = {
exported: false,
root: 'RootObject'
};
const json = getJsonFromSomewhere();
console.log(getTypes(json, options));
exported
: If true, will addexport
to all interfacesroot
: Specify the name of the root object interface (defaults to'RootObject'
)