New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

connectors

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connectors

Nodejs Database connectors

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Database Connectors

Nodejs unify database connectors

npm package issues pull requests bitHound Overall Score bitHound Code

How to

npm install connectors
// define array of connection info
let database = [
    {
        connector_name: 'mongoose',
        host: '127.0.0.1',
        port: '27017',
        db_name: 'db_test'
    }
];

// require somewhere globally during application start/setup/init
require('connectors').init(database);

// and use like that in your model:
const {mongoose} = require('connectors');
// or
db.rabbitmq.sendToQueue('queue_name', new Buffer('something...'))

Settings Configuration Example

const settings = [
    {
        connector_name: 'mongoose',
        host: 'localhost',
        port: '',
        db_name: ''
    },
    {
        connector_name: 'mysql',
        host: 'localhost',
        port: '',
        db_name: ''
    }
];

TODO:

  1. support multi connection at the same db.
  2. connect all configured db at once(async).
  3. consider if i need mysql + redis export in index.js
  4. mongoose promise is dep: "(node:11663) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html"

FAQs

Package last updated on 09 Dec 2017

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