Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/parse-procfile
Parse a procfile into an object
https://github.com/binocarlos/parse-procfile
Last synced: 10 days ago
JSON representation
Parse a procfile into an object
- Host: GitHub
- URL: https://github.com/binocarlos/parse-procfile
- Owner: binocarlos
- Created: 2014-07-29T18:40:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-29T18:43:36.000Z (over 10 years ago)
- Last Synced: 2024-10-28T13:16:16.856Z (23 days ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## parse-procfile
Parse a procfile into an object
## install
```bash
$ npm install parse-procfile
```## usage
Take this Procfile:
```
web: node myserver --port 80
db: mysql --port 3306
```Parse it:
```js
var fs = require('fs')
var parse = require('parse-procfile')var content = fs.readFileSync(path.join(__dirname, 'test/Procfile'), 'utf8')
var obj = parse(content)
console.dir(obj)
```This would print:
```js
{
web:"node myserver --port 80",
db:"mysql --port 3306"
}
```## api
### `parse(string)`
Turn a procfile string into an object with keys for each entry.
It will throw an error if a parse error is found.
## licence
MIT