The ChangeLogs of Node.js

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Moto Ishizawa
February 01, 2012

The ChangeLogs of Node.js

The Changelogs of Node.js from v0.5.0 to v0.6.9.

Moto Ishizawa

February 01, 2012

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

27 slides
  1. var cp = require('child_process'); var n = cp.fork(__dirname + '/sub.js');

    n.on('message', function(m) { console.log('PARENT got message:', m); }); n.send({ hello: 'world' }); process.on('message', function(m) { console.log('CHILD got message:', m); }); process.send({ foo: 'bar' }); sub.js master.js
  2. Make Mikeal’s HTTP agent client the default. Use old HTTP

    client with --use-http1 “ ” Node.js v0.5.4
  3. var zlib = require('zlib'); var gzip = zlib.createGzip(); var fs

    = require('fs'); var inp = fs.createReadStream('input.txt'); var out = fs.createWriteStream('input.txt.gz'); inp.pipe(gzip).pipe(out);
  4. var cluster = require('cluster'); var http = require('http'); var numCPUs

    = require('os').cpus().length; if (cluster.isMaster) { // Fork workers. for (var i = 0; i < numCPUs; i++) { cluster.fork(); } cluster.on('death', function(worker) { console.log('worker ' + worker.pid + ' died'); }); } else { // Worker processes have a http server. http.Server(function(req, res) { res.writeHead(200); res.end("hello world\n"); }).listen(8000); }
  5. #2083 Land NPM in Node. It is included in packages/installers

    and installed on `make install` “ ” Node.js v0.6.3

More Decks by Moto Ishizawa

Other Decks in Programming