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

mongopatch

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongopatch - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

2

package.json
{
"name": "mongopatch",
"version": "0.8.0",
"version": "0.8.1",
"repository": "git://github.com/e-conomic/mongopatch.git",

@@ -5,0 +5,0 @@ "description": "MongoDB patching tool",

@@ -168,2 +168,6 @@ mongopatch [![Build Status](https://travis-ci.org/e-conomic/mongopatch.png?branch=master)](https://travis-ci.org/e-conomic/mongopatch)

#### Version 0.8.1
- Make it possible to pass a `mongojs` database instance to `mongopatch` when used programmatically (the database is not closed).
#### Version 0.8.0

@@ -170,0 +174,0 @@

@@ -15,2 +15,17 @@ var util = require('util');

var getDatabase = function(db) {
return (typeof db === 'string') ? mongojs(db) : db;
};
var closeDatabase = function(db, original) {
var close = function(callback) {
db.close(callback);
};
var noop = function(callback) {
callback();
};
return (typeof original === 'string') && db ? close : noop;
};
var propagateError = function(src, dest) {

@@ -27,5 +42,8 @@ src.on('error', function(err) {

var create = function(patch, options) {
var applicationDb = mongojs(options.db);
var logDb = options.logDb && mongojs(options.logDb);
var applicationDb = getDatabase(options.db);
var logDb = options.logDb && getDatabase(options.logDb);
var closeApplicationDb = closeDatabase(applicationDb, options.db);
var closeLogDb = closeDatabase(logDb, options.logDb);
var progress = {

@@ -180,12 +198,4 @@ total: 0,

async.parallel([
function(next) {
applicationDb.close(next);
},
function(next) {
if(!logDb) {
return next();
}
logDb.close(next);
}
closeApplicationDb,
closeLogDb
], callback);

@@ -192,0 +202,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