procfile
Version:
A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)
52 lines (39 loc) • 996 B
Markdown
A Procfile parser for node.js.
```
curl http://npmjs.org/install.sh | sh
```
```
[] npm install procfile
```
There are two simple methods when using `node-procfile`: `.parse()` and `.stringify()`. If you are familiar with using the native `JSON` methods in Javascript, there is nothing new about the API.
``` js
var fs = require('fs'),
procfile = require('procfile');
var data = fs.readFileSync('/path/to/procfile').toString(),
proc = procfile.parse(data);
console.dir(proc)
```
This outputs the results of the procfile parse:
``` js
{
web: {
command: 'node',
options: [ 'myapp.js', '-p', '80', '--some-option' ]
},
worker: {
command: 'node',
options: [ 'myworker.js', '--other-option' ]
}
}
```
``` bash
$ vows --spec
```
[]: http://nodejitsu.com