Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sc5/exec-wait
A simple promiseful execution utility that waits for input from stdout or a HTTP/HTTPS request to return until giving the control to the next command in the chain.
https://github.com/sc5/exec-wait
Last synced: 8 days ago
JSON representation
A simple promiseful execution utility that waits for input from stdout or a HTTP/HTTPS request to return until giving the control to the next command in the chain.
- Host: GitHub
- URL: https://github.com/sc5/exec-wait
- Owner: SC5
- Created: 2014-07-07T09:12:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T16:53:12.000Z (almost 9 years ago)
- Last Synced: 2024-10-23T09:11:14.927Z (25 days ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exec-wait
A simple promiseful execution utility that waits for input from stdout or a
HTTP/HTTPS request to return until giving the control to the next command in
the chain.Useful e.g. for test automation process chains etc.
## Installation
> npm install exec-wait
## Usage
var ghostDriver = exec({
name: 'Ghostdriver',
cmd: path.join(require.resolve('phantomjs'), '../phantom/bin',
'phantomjs' + (process.platform === 'win32' ? '.exe' : '')),
args: ['--webdriver=4444', '--ignore-ssl-errors=true'],
monitor: { stdout: 'GhostDriver - Main - running on port 4444' }
});var cmdAndArgs = require('package.json').scripts.start.split(/\s/),
testServer = exec({
name: 'Test server',
cmd: cmdAndArgs[0],
args: cmdAndArgs.slice(1),
monitor: {
url: 'http://localhost:8080/',
checkHTTPResponse: false
},
httpOptions: {
rejectUnauthorized: false
}
});testServer.start()
.then(ghostDriver.start)
.then(function() {
// Do something
})
.then(ghostDriver.stop)
.then(testServer.stop);httpOptions can be used to pass options to http / https modules. e.g. rejectUnauthorized skips certificate validity checks (required for self-signed certificates)
## License
Copyright (c) 2014 [SC5](http://sc5.io/), licensed for users and contributors under MIT license.
https://github.com/sc5/grunt-bobrsass-boilerplate/blob/master/LICENSE-MIT