Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

migroose

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

migroose - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

3

gruntfile.js

@@ -0,1 +1,4 @@

var util = require("util");
util.print = process.stdout.write.bind(process.stdout);
module.exports = function(grunt){

@@ -2,0 +5,0 @@ grunt.initConfig({

42

migroose/stepRunner/index.js

@@ -17,33 +17,25 @@ var RSVP = require("rsvp");

StepRunner.prototype.run = function(data, cb){
StepRunner.prototype.run = function(data, done){
var that = this;
function getStepRunner(step){
return function(resolve, reject){
var done = function(err){
if (err) {
reject(err);
} else {
resolve();
}
};
function runStep(steps, data, done){
if (steps.length === 0) {
return done();
}
step.call(undefined, data, done);
};
}
var step = steps.shift();
var promises = [];
this.steps.forEach(function(step){
var runner = getStepRunner(step);
var p = new RSVP.Promise(runner);
promises.push(p);
});
function next(){
setImmediate(function(){
runStep(steps, data, done);
});
}
RSVP.all(promises)
.then(function(){
cb(null);
})
.catch(function(err){
cb(err);
step(data, function(err){
if (err) { return done(err); }
return next();
});
}
runStep(this.steps, data, done);
};

@@ -50,0 +42,0 @@

{
"name": "migroose",
"version": "0.2.1",
"version": "0.3.0",
"description": "migration framework for mongoosejs and MongoDB",

@@ -5,0 +5,0 @@ "main": "migroose/index.js",

@@ -16,14 +16,20 @@ var AsyncSpec = require("node-jasmine-async");

migration.step(function(data, stepComplete){
stepsRun.push(1);
stepComplete();
setTimeout(function(){
stepsRun.push(1);
stepComplete();
}, 50);
});
migration.step(function(data, stepComplete){
stepsRun.push(2);
stepComplete();
setImmediate(function(){
stepsRun.push(2);
stepComplete();
});
});
migration.step(function(data, stepComplete){
stepsRun.push(3);
stepComplete();
setTimeout(function(){
stepsRun.push(3);
stepComplete();
}, 10);
});

@@ -30,0 +36,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc