@drifted/db 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # db
2
+
3
+ ```bash
4
+
5
+ npm install @drifted/db --save
6
+
7
+ ```
8
+
9
+ ```javascript
10
+ require('@drifted/db');
11
+ ```
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ const path = require('path');
2
+ require('@drifted/env');
3
+ var initialize = require(path.join(__dirname, 'initialize'));
4
+
5
+ initialize(process.env.MONGO_URL).
6
+ catch(console.eror);
package/initialize.js ADDED
@@ -0,0 +1,11 @@
1
+ const mongoose = require('mongoose');
2
+ const path = require('path');
3
+
4
+ function initialize(url) {
5
+ if (url == undefined && process.env.MONGO_URL != undefined) {
6
+ url = process.env.MONGO_URL;
7
+ }
8
+ return mongoose.connect(url)
9
+ }
10
+
11
+ module.exports = initialize;
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@drifted/db",
3
+ "version": "0.0.1",
4
+ "description": "db module that allows me to establish conventions between projects",
5
+ "homepage": "https://github.com/driftless-group/db#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/driftless-group/db/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/driftless-group/db.git"
12
+ },
13
+ "license": "UNLICENSED",
14
+ "author": "Scott Ballantyne",
15
+ "type": "commonjs",
16
+ "main": "index.js",
17
+ "scripts": {
18
+ "test": "mocha -w"
19
+ },
20
+ "dependencies": {
21
+ "@drifted/env": "^0.0.2"
22
+ }
23
+ }