nats-server-control

0.0.1 • Public • Published

NATS Server Control

This has been cherry picked from node-nats and slightly modified to allow promise syntax. Kudos to Apcera and the author(s) of that repo!

Start, stop and kill the gnatsd process from javascript. Useful during testing where a NATS bus is needed.

Start and stop a NATS server

var nsc = require('nats-server-control');

// Start gnatsd on localhost:4222 
var server = nsc.startServer(4222, { /* optional opts })
  .then(function() {
     // up an running
  })
  .catch(function(err) {
    // catch error
  });

// Stop server
nsc.stopServer(server);

// Or if you'd like
// server.kill();

Example

Check out spec/example.spec.js for example usage in a jasmine test.

Readme

Keywords

Package Sidebar

Install

npm i nats-server-control

Weekly Downloads

32

Version

0.0.1

License

MIT

Last publish

Collaborators

  • joelso