quickly
Quickly setups dependent services and servers for local development
Inspired by Aviator.
Often your application requires other services to run. If you develop locally, starting a particular version
of a service locally, or pointing at a remote can be complicated. Quickly
solves this. Just write
a local quickly.js
file in each project that provides local service or needs other local services.
Then start all other services needed by entering quickly
. If there are multiple configurations,
quickly
will ask you.
Example
Imagine project A depends on the application B to be running. A could be a server and B could be an API.
In the A's root folder create new file quickly.js
moduleexports = // this project provides service A A: dependencies: path: '../B' service: 'API' // which service to load from ../B/quickly.js // service A starts 'npm run dev' exec: 'npm' args: 'run dev' ;
Create another quickly.js
file in the project B folder
// project B provides API servicemoduleexports = API: exec: 'npm' args: 'run watch' ;
Lifecycle
When starting a project A using quickly
command all dependent child processes will be started.
When you kill the project A (using Command+C), all child processes will be killed too.
Choices
A quickly.js
file can export multiple configurations / services. In this case the system
will ask the user which service to ask. For example, if quickly.js
has
moduleexports = test1: exec: 'echo' args: 'running test 1' test2: exec: 'echo' args: 'running test 2' ;
Then the shell will be
$ quickly quickly@0.1.4 - Quickly setup dependent services and servers
Other projects can specify which service to start without prompting the service
property
A: dependencies: path: '../two-choices' service: 'test2' // do not ask the user, just start test2 ...
For more configuration examples, browser the test folder.
Install
npm install -g quickly
In each project create quickly.js
as shown in the example.
Small print
Author: Gleb Bahmutov © 2015 @bahmutov glebbahmutov.com glebbahmutov.com/blog
License: MIT - do anything with the code, but don't blame me if it does not work.
Spread the word: tweet, star on github, etc.
Support: if you find any problems with this module, email / tweet / open issue on Github