GithubHelp home page GithubHelp logo

j3lamp / runninator Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.07 MB

A generic runner ideal for a front-end hot reload server and application server.

License: MIT License

Makefile 2.80% JavaScript 75.21% CSS 20.38% HTML 1.61%

runninator's Introduction

Runninator

A generic runner ideal for a front-end hot reload server and application server.

Runninator is designed for running things like your application server along with a webpack development server, or similar. This is not designed for running build tasks but rather a way to start multiple servers required for development together while providing the ability to control them individually.

Install

npm install --save-dev runninator

Usage

runninator <config file>

Once launched runninator will start each of the commands listed in the configuration file and provide a prompt for controlling them. Allowing individual commands to be restarted, stopped, and started again.

Configuring

Runninator expects a JavaScript file that exports a configuration object.

Example

module.exports = {
    app: {command: ["node", "app.js"],
          color:   "green"},
    wp:  {command: ["npm", "run", "webpack"],
          color:   "blue"}
};

Each entry maps the name runninator will use to the actual command to be run. The color field id optional and one will be picked automatically if omitted or invalid. Valid colors are:

  • green
  • blue
  • cyan
  • magenta
  • yellow

Red is reserved for displaying errors.

Limitations

  • Not tested on Windows, but in theory it should work.
  • With node.js 4 commands cannot always be stopped, for example any command started using an npm script. This is due to a documented bug that was fixed in later versions. nodejs/node#2098
  • Not tested with node.js versions prior to 4.

Example Run

Starting app...
Starting wp...
app | $ open http://127.0.0.1:7001
wp  | Listening at http://localhost:7002/
run > help
Control Commands:
    start <command name>    Start a stopped command.
    stop <command name>     Stop a running command.
    restart <command name>  Restart a running command.

  Note: Control commands and command names can be entered in reverse order.
        The special command names 'all' and '*' can be used to control all the
        commands together.

Global Control Commands:
    status  Print the status of all commands.
    quit    Stop all commands and quit this.
    help    Print this help.

Commands:
    app  node app.js
    wp   node dev-server.js
wp  | Hash: cb9b46aed96961bfa659
wp  | Version: webpack 1.13.1
wp  | Time: 2829ms
wp  |     Asset     Size  Chunks             Chunk Names
wp  | bundle.js  1.08 MB       0  [emitted]  main
wp  | chunk    {0} bundle.js (main) 945 kB [rendered]
wp  |     [0] multi main 52 bytes {0} [built]
wp  |     [1] (webpack)-dev-server/client?http://localhost:7002 2.67 kB {0} [built]
wp  |     [2] ./~/url/url.js 22.3 kB {0} [built]
wp  |     [3] ./~/url/~/punycode/punycode.js 14.6 kB {0} [built]
wp  |     [4] (webpack)/buildin/module.js 251 bytes {0} [built]
wp  |     [5] ./~/querystring/index.js 127 bytes {0} [built]

wp  |   [255] ./~/component-emitter/index.js 3 kB {0} [built]
wp  |   [256] ./~/reduce-component/index.js 405 bytes {0} [built]
wp  |   [257] ./public/javascripts/components/footer.js 3.38 kB {0} [built]
wp  |   [258] ./public/javascripts/components/todo_list.js 2.93 kB {0} [built]
wp  |   [259] ./public/javascripts/components/todo.js 3.63 kB {0} [built]
wp  |   [260] ./~/classnames/index.js 1.1 kB {0} [built]
wp  | webpack: bundle is now VALID.
app |   <-- GET /tasks
app |   --> GET /tasks 200 15ms -
run > status
Process status:
  app running
  wp  running
app |   <-- GET /tasks
app |   --> GET /tasks 200 5ms -
run > stop wp
Stopping wp...
run > restart app
Restarting app...
app | $ open http://127.0.0.1:7001
run > status
Process status:
  app running
  wp  stopped
run > start wp
Starting wp...
wp  | Listening at http://localhost:7002/
wp  | Hash: cb9b46aed96961bfa659
wp  | Version: webpack 1.13.1
wp  | Time: 2845ms
wp  |     Asset     Size  Chunks             Chunk Names
wp  | bundle.js  1.08 MB       0  [emitted]  main
wp  | chunk    {0} bundle.js (main) 945 kB [rendered]
wp  |     [0] multi main 52 bytes {0} [built]
wp  |     [1] (webpack)-dev-server/client?http://localhost:7002 2.67 kB {0} [built]
wp  |     [2] ./~/url/url.js 22.3 kB {0} [built]
wp  |     [3] ./~/url/~/punycode/punycode.js 14.6 kB {0} [built]
wp  |     [4] (webpack)/buildin/module.js 251 bytes {0} [built]
wp  |     [5] ./~/querystring/index.js 127 bytes {0} [built]

wp  |   [255] ./~/component-emitter/index.js 3 kB {0} [built]
wp  |   [256] ./~/reduce-component/index.js 405 bytes {0} [built]
wp  |   [257] ./public/javascripts/components/footer.js 3.38 kB {0} [built]
wp  |   [258] ./public/javascripts/components/todo_list.js 2.93 kB {0} [built]
wp  |   [259] ./public/javascripts/components/todo.js 3.63 kB {0} [built]
wp  |   [260] ./~/classnames/index.js 1.1 kB {0} [built]
wp  | webpack: bundle is now VALID.
run > quit
Stopping app...
Stopping wp...
run >

License

© John Lamp

MIT license

runninator's People

Contributors

j3lamp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.