Skip to content

Commit

Permalink
Merge pull request seanemmer#32 from s-kazuki/update_npms
Browse files Browse the repository at this point in the history
update outdated npms to fix audit suggestions and deprecated method in mongoose
  • Loading branch information
seanemmer authored Feb 24, 2019
2 parents 9dc7dd0 + 6c31d51 commit f5cec22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Seeder.prototype.connect = function(...params) {
cb = params[1];
} else if (params.length == 3) {
db = params[0];
opts = params[1];
cb = params[2];
opts = params[1];
cb = params[2];
} else {
console.error('Pass either 2 or 3 arguments to seeder.connect');
console.error('Pass either 2 or 3 arguments to seeder.connect');
process.exit(1);
}

Expand All @@ -59,14 +59,16 @@ Seeder.prototype.connect = function(...params) {
cb();
} else {
if (opts) {
mongoose.connect(db, opts, function (err) {
afterConnect(_this, err, cb);
});
opts.useNewUrlParser = true;
} else {
mongoose.connect(db, function (err) {
afterConnect(_this, err, cb);
});
opts = {
useNewUrlParser: true
};
}

mongoose.connect(db, opts, function (err) {
afterConnect(_this, err, cb);
});
}
};

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Seed data population for Mongoose",
"main": "index.js",
"scripts": {
"test": "mocha test/**/*.js"
"test": "mocha --exit test/**/*.js"
},
"repository": {
"type": "git",
Expand All @@ -28,14 +28,14 @@
},
"homepage": "https://github.com/seanemmer/mongoose-seed#readme",
"dependencies": {
"async": "~1.2.0",
"chalk": "~1.0.0",
"lodash": "~4.17.10",
"path": "~0.11.14"
"async": "~2.6.1",
"chalk": "~2.4.2",
"lodash": "~4.17.11",
"path": "~0.12.7"
},
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.0.0",
"mongoose": "^4.5.8"
"chai": "^4.2.0",
"mocha": "^5.2.0",
"mongoose": "^5.4.8"
}
}

0 comments on commit f5cec22

Please sign in to comment.