Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/dispatch-spawn
Execute fleet-spawn in a given git repo
https://github.com/nisaacson/dispatch-spawn
Last synced: about 1 month ago
JSON representation
Execute fleet-spawn in a given git repo
- Host: GitHub
- URL: https://github.com/nisaacson/dispatch-spawn
- Owner: nisaacson
- Created: 2013-05-02T19:01:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-03T16:14:51.000Z (over 11 years ago)
- Last Synced: 2024-04-14T14:46:34.067Z (7 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dispatch Spawn
Execute fleet-spawn in a given git repo[![Build Status](https://travis-ci.org/nisaacson/dispatch-spawn.png)](https://travis-ci.org/nisaacson/dispatch-spawn)
# Installation
```bash
npm install -S dispatch-spawn
```# Usage
To spawn a command, pass all the required parameters to the dispatch-spawn module
```javascript
var inspect = require('eyespect').inspector();
var dispatchSpawn = require('dispatch-spawn')
var repoDir = '/path/to/checked/out/repo'
var command = 'node startServer.js' // command to spawn
var host = 'localhost' // fleet hub host
var port = 4002 // fleet hub port
var secret = 'foo_secret' // fleet hub secretvar data = {
repoDir: repoDir,
host: host,
port: port,
secret: secret,
command: command
}
dispatchSpawn(data, function (err) {
if (err) {
console.log(err.stack)
delete err.stack
inspect(err, 'error spawning command')
return
}
inspect('command spawned correctly')
})
```# Test