Mongoose models to Typescript interfaces generator
Script generates typescript interfaces with all properties from mongoose models.
npm install mon2ts --save
//get generator scriptlet m2t = require;//get mongoose modellet model = require;//generate typescript interface as stringlet str = m2t;//save the string as .ts somewhere you need it
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.