Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "To import modules into your Node program use the require
directive."
A block of code is set as follows:
var EventEmitter = require('events').EventEmitter; var Counter = function(init) { this.increment = function() { init++; this.emit('incremented', init); }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
var size = process.argv[2];
var totl = process.argv[3] || 100;
var buff = [];
for(var i=0; i < totl; i++) {
buff.push(new Buffer(size));
process.stdout.write(process.memoryUsage().heapTotal + "\n");
}
Any command-line input or output is written as follows:
> node process.js 1000000 100 > out.file
New terms and important words are shown in bold.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.