@kuronekomichael/node-embedded-mongodb

0.0.2 • Public • Published

Build Status

Node.js embedded mongoDb module

This is a simple module which start/stop an already installed, existing, localhost mongod server.

This module is very useful for running mongodb as part of a Gulp/Grunt testing task.

Getting Started

Install mongodb

Install the module with: npm install node-embedded-mongodb

Then, use it:

var embeddedMongoDB = require('node-embedded-mongodb');

var dbPath = '/path/to/data/db/';
var logPath = '/path/to/mongod.log';

// If you don't want the logs, set true.
embeddedMongoDB.silentMode(true);

embeddedMongoDB.start(dbPath, logPath, function(err) {

// mongodb://localhost:27017 is UP
)};

OR

embeddedMongoDB.start(null, null, function(err) {

// mongodb://localhost:27017 is UP
// created a local embedded/data/db folder and a local embedded/log file
)};

embeddedMongoDB.stop(function(err) {

// mongodb://localhost:27017 is DOWN
)};

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.

License

Copyright (c) 2015 Adam Gavish
Licensed under the MIT license.

Package Sidebar

Install

npm i @kuronekomichael/node-embedded-mongodb

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • kuronekomichael