Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Pew Pew Laser Blog Archives — by Blog ID

Notes - Intro to Node.

5.14.2014

Several months ago I went to a 3 hour Intro to Node.js workshop through Meetup by Ryan Eastridge of Formidable Labs. Here are the notes I took. Beware - without Ryan's walk-though, some of the stuff here doesn't make much sense.

Node's strength is asynchronicity - there is no halt while waiting for a response.

$ node [filename]    #execute that file
$ localhost:8000     #from NOT Node console
var fs=require("fs");
fs.writeFileSync("hw.txt", "Hello World");
#Possible, but use async and callbacks.

Modules installed during workshop: Express, Request, Cheerio. Other useful modules: easyxdm, socket.io, simonl. Also github.com/caolan/async; to avoid callback hell - set up in series.

Shouter: process.stdin.resume(); #Don't exit, wait for input

Permalink

Tags: code javascript node

Authorized users may log-in to leave a comment.

Last Blog: A Glassblower's Career Outlook.

Next Blog: CSS Magic - border-box.