Fork me on GitHub

node-mktmpio

A simple Node.js module that includes a basic version of our CLI as an example.

GitHub
mktmpio/node-mktmpio
npm
mktmpio
var mktmpio = require('mktmpio');

mktmpio.create('redis', function(err, res) {
  if (err || res.error) {
    console.error('error creating instance:', err || res.error);
    return process.exit(1);
  }

  // Do stuff here:
  // res.host
  // res.port
  // res.password

  mktmpio.destroy(res.id, function(err, res) {
    if (err || res.error) {
      console.error('error terminating service:', err || res.error);
    } else {
      console.log('instance %s terminated', instance.id);
    }
  });
});