modules.data.database
Advanced tools
Comparing version 0.0.3 to 0.0.4
20
index.js
@@ -1,9 +0,15 @@ | ||
function Database (connectionString) { | ||
var mongoose = require('mongoose'); | ||
mongoose.connect(connectionString); | ||
this.disconnect = function () { | ||
mongoose.connection.close(); | ||
module.exports = { | ||
mongoose: null, | ||
connectionString: null, | ||
connect: function () { | ||
this.mongoose.connect(this.connectionString); | ||
}, | ||
disconnect: function () { | ||
this.mongoose.connection.close(); | ||
}, | ||
init: function (connectionString) { | ||
this.mongoose = require('mongoose'); | ||
this.connectionString = connectionString; | ||
this.connect(); | ||
} | ||
return this; | ||
} | ||
module.exports = Database; |
{ | ||
"name" : "modules.data.database", | ||
"description" : "A database module for MongoDB.", | ||
"version" : "0.0.3", | ||
"version" : "0.0.4", | ||
"author" : { | ||
@@ -6,0 +6,0 @@ "name" : "Braun Goodson", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
725
15
0