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

mongojs

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongojs - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

42

index.js
var mongodb = require('mongodb');
var memolite = require('memolite');

@@ -9,26 +10,2 @@ var DRIVER_COLLECTION_PROTO = mongodb.Collection.prototype;

var memoize = function(fn) {
var callFn = function(callback) {
var stack = [callback];
action = function(callback) {
stack.push(callback);
};
fn(function(err, val) {
action = err ? callFn : function(callback) {
callback(null, val);
};
while (stack.length) stack.shift()(err, val);
});
};
var action = callFn;
return function(callback) {
action(callback);
};
};
var forEachMethod = function(oldProto, newProto, fn) {

@@ -115,3 +92,3 @@ Object.keys(oldProto).forEach(function(methodName) {

var oncollection = this._get;
var oncursor = memoize(function(callback) {
var oncursor = memolite(function(callback) {
args.push(callback);

@@ -204,6 +181,2 @@ oncollection(function(err, collection) {

var ObjectId = function(id) {
return new mongodb.ObjectID(id);
};
var connect = function(config, collections) {

@@ -213,3 +186,3 @@ var that = {};

var ondb = memoize(function(callback) {
var ondb = memolite(function(callback) {
mongodb.Db.connect(connectionString, function(err, db) {

@@ -222,10 +195,9 @@ if (err) return callback(err);

that.bson = mongodb.BSONPure;
that.bson = mongodb.BSONPure; // backwards compat
that.ObjectId = mongodb.ObjectID; // backwards compat
that.ObjectId = ObjectId;
that.collection = function(name) {
if (that[name]) return that[name];
var oncollection = memoize(function(callback) {
var oncollection = memolite(function(callback) {
ondb(function(err, db) {

@@ -258,3 +230,3 @@ if (err) return callback(err);

connect.connect = connect; // backwards compat
connect.ObjectId = ObjectId;
connect.ObjectId = mongodb.ObjectID;
module.exports = connect;

5

package.json

@@ -5,3 +5,3 @@ {

"keywords": ["mongo", "db", "mongodb"],
"version":"0.6.3",
"version":"0.6.4",
"repository": "git://github.com/gett/mongojs.git",

@@ -14,3 +14,4 @@ "author": "Ge.tt <hello@ge.tt>",

"dependencies": {
"mongodb":"1.2.x"
"mongodb":"1.2.x",
"memolite":"~0.1.0"
},

@@ -17,0 +18,0 @@ "scripts": {

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