40. ##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
・・・
42. インプットアウトプット
$ node readwrite.js
---- reaswrite.js ----
var fs = require('fs');
var r = fs.createReadStream('/etc/hosts');
var w = fs.createWriteStream('hosts2.copy');
r.on('data', function(data) {
w.write(data.toString().toUpperCase());
});