Skip to content

mongodb-js/mongorc

 
 

Repository files navigation

mongorc

build status

Work with ~/.mongorc.js programmatically.

Example

var mongorc = require('mongorc');
mongorc.contents(function(err, s){
  console.log('contents of current ~/.mongodb.js: ', s);

  mongorc.backup(function(err){
    if(err) return console.error('Backup failed: ', err);

    // .. do stuff ..
    // .. on nos!  we had an error!

    mongorc.restore(function(){
      console.log('restored ~/.mongodb.js');
      
      mongorc.contents(function(err, s){
        console.log('contents of current ~/.mongodb.js: ', s);
      });
    });
  });
});

Install

npm install --save mongodb-js/mongorc

License

Apache 2

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%