https://github.com/indexzero/node-procfile
Procfile parser for node.js
https://github.com/indexzero/node-procfile
Last synced: 9 months ago
JSON representation
Procfile parser for node.js
- Host: GitHub
- URL: https://github.com/indexzero/node-procfile
- Owner: indexzero
- Created: 2011-06-13T08:23:40.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2012-08-24T18:22:41.000Z (almost 14 years ago)
- Last Synced: 2025-08-24T18:30:42.059Z (10 months ago)
- Language: JavaScript
- Homepage: http://github.com/indexzero/node-procfile
- Size: 105 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-procfile
A Procfile parser for node.js.
## Installation
### Installing npm (node package manager)
```
curl http://npmjs.org/install.sh | sh
```
### Installing node-procfile
```
[sudo] npm install procfile
```
## Usage
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' ]
}
}
```
## Run Tests
``` bash
$ vows --spec
```
#### Author: [Charlie Robbins][0]
[0]: http://nodejitsu.com