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

binder-db

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binder-db

Binder module for consistent database management across components

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

binder-db

Functions for consistent database access across from all Binder modules

All Binder modules expect to have access to a writable MongoDB instance. The db service provided by binder-control, started with binder-control start-service db will launch a Docker container with a preconfigured Mongo instance (and configurable properties in binder-control).

All configuration options are in conf/main.json.

andrew@binder-api:~/binder-db$ cat conf/main.json
{
  "host": "localhost",
  "port": 9050,
  "db": "binder"
}

install

npm install binder-db

api

getDatabase(cb)

Returns a Mongoose db wrapper that's connected to the main Binder database

  • cb function - callback(err, db)

usage

var getDatabase = require('binder-db')
getDatabase(function (err, db) {
  // register models with the db, etc.
})

examples

var getDatabase = require('binder-db')
getDatabase(function (err, db) {
  self.db = db
  self.buildInfo = db.model('Build', BuildInfoSchema)
  self.templates = db.model('Templates', registry.TemplateSchema)
})

Keywords

FAQs

Package last updated on 21 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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