Skip to content

Instantly share code, notes, and snippets.

@shankie-codes
Created January 10, 2017 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankie-codes/38d8e788eac15209b11c5e62c623e749 to your computer and use it in GitHub Desktop.
Save shankie-codes/38d8e788eac15209b11c5e62c623e749 to your computer and use it in GitHub Desktop.
A Sublime Text snippet for creating Mongoose.js models
<snippet>
<content><![CDATA[
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:SchemaName}}Schema = new Schema({
name: { type: 'String', required: true }
});
export default mongoose.model('${1:SchemaName}', ${1:SchemaName}Schema);
]]></content>
<tabTrigger>mmdl</tabTrigger>
<scope>source.js -(meta)</scope>
<description>Mongoose: model definition</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment