Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including procfile with all npm packages installed. Try it out:

var procfile = require("procfile")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

procfile v0.1.1

A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)

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.

  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:

  {
    web: {
      command: 'node',
      options: [ 'myapp.js', '-p', '80', '--some-option' ]
    },
    worker: {
      command: 'node',
      options: [ 'myworker.js', '--other-option' ]
    }
  }

Run Tests

  $ vows --spec

Author: Charlie Robbins

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free