npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

gulp-mongoose-scenario

1.2.4 • Public • Published

Gulp-Mongoose-Scenario

Gulp wrapper for mongoose-scenario.

Installation

Install via NPM:

npm install --save-dev gulp-mongoose-scenario

Usage:

gulp.task('db', function(next) {
    // Load all config files including your main DB handler
    global.config = require('./config/global');
    require('./config/db');
 
    // Load all modules
    require('./models/users');
    require('./models/projects');
    require('./models/products');
    require('./models/productCategories');
 
    // Slurp in all the .json files located in models/scenarios and run them though mongoose-scenario
 
    var scenario = require('gulp-mongoose-scenario');
    gulp.src('models/scenarios/**/*.json')
        .pipe(scenario({connection: db, nuke: true}))
        .on('end', function(err) {
            if (err) return next(err);
            next();
        });
});

install

npm i gulp-mongoose-scenario

Downloadsweekly downloads

2

version

1.2.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability