npm

Need private packages and team management tools?Check out npm Orgs. »

mon2ts

1.0.8 • Public • Published

Mongoose models to Typescript interfaces generator

N|Solid

Script generates typescript interfaces with all properties from mongoose models.

Install:

npm install mon2ts --save

Example usage:

//get generator script
let m2t = require('mon2ts');
//get mongoose model
let model = require('./models/MyModel');
//generate typescript interface as string
let str = m2t(model);
//save the string as .ts somewhere you need it

Additional info:

Script automatically generates import statements for referred models & additional interfaces for nested objects. Accepted type for referred mongoose model is either id or populated interface.

Keywords

none

install

npm i mon2ts

Downloadsweekly downloads

3

version

1.0.8

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability