nDistro Screencast - NodeJS Deployments In Seconds
I decided to take some time and go screencast-happy today, the first screencast is an introduction to my nDistro nodejs distribution toolkit. nDistro allows you to create node deployments in a matter of seconds.
Ps. Dont mind my annoying bird! here is the screencast
nDistro - Node distribution toolkit
nDistro is a small bash project that allows you to define, and install node distributions within seconds. This means no GIT dependency, no compiling node from source with Make, no need to install node then install npm (node’s package manager).
nDistro distributions are easy to create, share, and install. Before we get into the details lets install nDistro:
$ cd /usr/local/bin && curl http://github.com/visionmedia/ndistro/raw/master/install | sh
Creating a Node Distribution
Pre-installed distributions take the shape of a single dotfile named .ndistro, which is
actually a bash script loaded by ndistro. Here is an example of one of mine:
node 0.1.102
module senchalabs connect
module visionmedia express 1.0.0beta2
module visionmedia connect-form
module visionmedia connect-redis
module fictorial redis-node-client
module visionmedia jade
module visionmedia ejs
We specify the pre-compiled node binary version, as well as several modules defined by:
module <username> <project> [version]
Currently the node binaries are fetched from my “nodes” repo, so feel free to contribute some nodes :D
Installing a Distribution
Installing a distro is even easier! In the directory containing .ndistro execute:
$ ndistro
You should see the following stdout (or similar):
$ ndistro
... installing connect
... installing express
... installing connect-form
... installing connect-redis
... installing redis-node-client
... installing jade
... installing ejs
... installing node 0.1.102
... installation complete
BAM!! you now have bin/node, and bin/express to get started creating some cool web apps. Try it out:
$ ./bin/node
node> require('express')
{ version: '1.0.0beta2'
, Server: { [Function] super_: { [Function] super_: [Object] } }
, createServer: [Function]
}
Updating A Distribution
Updating is easy too, want to re-install a module?:
$ rm -fr modules/connect-redis
and then run nDistro again:
$ ndistro
You should see something like:
... already installed connect
... already installed express
... already installed connect-form
... installing connect-redis
################################################ 100.0%
... already installed jade
... already installed ejs
... already installed redis-node-client
... already installed node-formidable
... already created application
... already installed node
... installation complete
Future Ideas
- Utilize Gists (or create a quick site) to share distro recipes.
- Utilize wget / curl depending on which is available
- Expand the API, perhaps allow app skeletons