express-server-with-commands

Start, stop, restart, and interrogate an Express instance

Usage no npm install needed!

<script type="module">
  import expressServerWithCommands from 'https://cdn.skypack.dev/express-server-with-commands';
</script>

README

express-server-with-commands

A wrapper for Express to provide start, stop, and restart functionality. Written out of annoyance and to avoid future copy/paste errors.

Usage

npm install express-server-with-commands
express = require('express-server-with-commands');

// Example setup
asyncOperation(function (results) {
  express.start();
});

// Example special cases
exampleListener.on('executiveOverride', function () {
  express.stop();
});
exampleListener.on('reset', function () {
  express.restart();
});