@coya/database
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -13,3 +13,10 @@ const crypto = require('crypto'); | ||
module.exports = class Database { | ||
static connect(dbName, dbLogin, dbPassword, config) { | ||
static connect(config) { | ||
const database = config.dbName || config.database || config.db || config.databaseName; | ||
const login = config.dbLogin || config.login; | ||
const password = config.dbPassword || config.password || config.pw; | ||
if(!database || !login || !password) | ||
throw new Error('Invalid database configuration object.'); | ||
logs = new Logs('database', config); | ||
@@ -16,0 +23,0 @@ return mongo.connect('mongodb://' + dbLogin + ':' + dbPassword + '@localhost:27017/' + dbName) |
{ | ||
"name": "@coya/database", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "MongoDB database service", | ||
@@ -12,5 +12,5 @@ "main": "database.js", | ||
"dependencies": { | ||
"@coya/logs": "0.0.3", | ||
"@coya/logs": "^0.0.4", | ||
"mongodb": "^2.2.33" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10820
323
+ Added@coya/logs@0.0.4(transitive)
- Removed@coya/logs@0.0.3(transitive)
Updated@coya/logs@^0.0.4