johnschimmel / itpjsweek_nodejs

Getting started with NodeJS examples for ITP's JavaScript Week

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started with NodeJS

"JavaScript servers? That's crazy."

Back to School movie poster with Rodney Dangerfield

A kind of re-birth

NodeJS joins the other popular web languages like Python, Ruby and PHP. It can access file systems, create and connect to servers, serve HTML, JSON and XML and manage user sessions.

NodeJS has the added benefit of JavaScript's asynchronous function execution.

The Good Parts

  • JavaScript language
    • Asynchronous
    • JSON, JavaScript Objects
    • Fun to write
  • Growing community
  • Very Web ready
  • Servers of past, present and future
    • TCP
      • HTTP
        • Websocket

Install NodeJS

Node is available for lots of different platforms including OSX, get a copy here http://nodejs.org/download/.

NPM - Node Package Manager

NPM is one of the nicest package managers. Using a package.json file you can declare an app's dependencies.

NPM is included when you download and install NodeJS. NPMJS.org is the official site for the application.

Node API

Node API

NodeJS Hosting

  • Heroku - great service. Git deployment. No websockets yet, only long polling.
  • Nodejitsu - NodeJS hosting and Websocket support
  • Any VPS server where you are allowed to run scripts as root, EC2, Linode, etc.

other tools

  • Nodemon - https://github.com/remy/nodemon - auto restart node script when you are developing
  • Forever - https://github.com/nodejitsu/forever - a process manager for Node. Use Forever to start a Node script then close the terminal window. With Forever you can come back to your shell and use the Forever command line to view, stop or restart the running Node scripts.

About

Getting started with NodeJS examples for ITP's JavaScript Week


Languages

Language:JavaScript 100.0%