Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Oct 13, 2011
1 parent c959174 commit 46b19f7
Showing 1 changed file with 46 additions and 16 deletions.
62 changes: 46 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
# Node.js Language Pack
Heroku buildpack: Node.js
=========================

The Node.js Language Pack will run `npm install` on your app after setting
up an appropriate environment of [node](http://github.com/joyent/node),
[npm](https://github.com/isaacs/npm) and [SCons](http://www.scons.org).
This is a [Heroku buildpack](#) for Node.js apps. It uses [NPM](#) and [SCons](#).

The `node_modules` directory will be cached between builds to allow for
faster `npm install` time.
Usage
-----

## Usage
Example usage:

Add this language pack to your `LANGUAGE_PACK_URL`.
$ ls
Procfile package.json web.js

heroku config:add LANGUAGE_PACK_URL="http://github.com/heroku/language-pack-nodejs.git"
$ heroku create --stack cedar --buildpack http://github.com/heroku/heroku-buildpack-nodejs.git

## Vendored Libraries
$ git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom buildpack
-----> Node.js app detected
-----> Vendoring node 0.4.7
-----> Installing dependencies with npm 1.0.8
express@2.1.0 ./node_modules/express
├── mime@1.2.2
├── qs@0.3.1
└── connect@1.6.2
Dependencies installed

The versions of node, npm and SCons used by the language pack are controlled
by the constants `NODE_VERSION`, `NPM_VERSION`, and `SCONS_VERSION` in
`bin/compile`
The buildpack will detect your app as Node.js if it has the file `package.json` in the root. It will use NPM to install your dependencies, and vendors a version of the Node.js runtime into your slug. The `node_modules` directory will be cached between builds to allow for faster NPM install time.

To use different versions of these tools, you can use the helper scripts
`support/package_node` and `support/package_npm`. These support scripts will
create binary tarballs that can be referenced by `bin/compile`.
Hacking
-------

To use this buildpack, fork it on Github. Push up changes to your fork, then create a test app with `--buildpack <your-github-url>` and push to it.

To change the vendored binaries for Node.js, NPM, and SCons, use the helper scripts in the `support/` subdirectory. You'll need an S3-enabled AWS account and a bucket to store your binaries in.

For example, you can change the vendored version of Node.js to v0.5.8.

First you'll need to build a Heroku-compatible version of Node.js:

$ export AWS_ID=xxx AWS_SECRET=yyy S3_BUCKET=zzz
$ s3 create $S3_BUCKET
$ support/package_node 0.5.8

Open `bin/compile` in your editor, and change the following lines:

NODE_VERSION="0.5.8"

S3_BUCKET=zzz

Commit and push the changes to your buildpack to your Github fork, then push your sample app to Heroku to test. You should see:

-----> Vendoring node 0.5.8

0 comments on commit 46b19f7

Please sign in to comment.