mongo-standalone
v0.0.3
Published
mongod initializer from node.js
Downloads
4
Readme
mongo-standalone
This is a javascript method that allows for control of the command-line
based mongod
instance from a node.js app. MongoDB must be downloaded
and the mongod
command available in your PATH.
Install:
npm install --save mongo-standalone
Usage:
const MongoDB = require('mongo-standalone');
const mongodOptions = {
dbpath: path.resolve('./data/db')
};
const mongod = MongoDB(mongodOptions, function (err, inst) {
if (err) {
process.exit();
return;
}
// inst.child === mongod which is returned from the function
// inst.kill === kill(mongod) using the tree-kill package
});
This code is UNTESTED in a production environment.
Released under the MIT license