This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

mern-model-generator

1.0.42 • Public • Published

Run the following command in the server directory to generate a template mern model (replace 'User' with your model name)

npm run create:model -name=User

The file will be located in the models folder, if a models folder does not already exist, one will be created

Output:

const { Schema, model } = require("mongoose");

const moment = require("moment");

const userSchema = new Schema(
	{
		createdAt: {
			type: Date,
			default: Date.now,
		},
	},
	{
		toJSON: {
			virtuals: true,
		},
	}
);

const User = model("User", userSchema);

module.exports = User;

Readme

Keywords

Package Sidebar

Install

npm i mern-model-generator

Weekly Downloads

0

Version

1.0.42

License

ISC

Unpacked Size

3.31 kB

Total Files

5

Last publish

Collaborators

  • laurawalters1