files system

// BLOCKING read a file and do something
var contents = fs.readFileSync('file')
console.log(contents)

// NON-blocking,
fs.readFile('file', cb(er, content){})

fs.unlink
is how to delete a file

all the commands

> fs.

fs.F_OK                  fs.FileReadStream        fs.FileWriteStream       fs.R_OK                  fs.ReadStream
fs.Stats                 fs.SyncWriteStream       fs.W_OK                  fs.WriteStream           fs.X_OK
fs._toUnixTimestamp      fs.access                fs.accessSync            fs.appendFile            fs.appendFileSync
fs.chmod                 fs.chmodSync             fs.chown                 fs.chownSync             fs.close
fs.closeSync             fs.constants             fs.copyFile              fs.copyFileSync          fs.createReadStream
fs.createWriteStream     fs.exists                fs.existsSync            fs.fchmod                fs.fchmodSync
fs.fchown                fs.fchownSync            fs.fdatasync             fs.fdatasyncSync         fs.fstat
fs.fstatSync             fs.fsync                 fs.fsyncSync             fs.ftruncate             fs.ftruncateSync
fs.futimes               fs.futimesSync           fs.lchmod                fs.lchmodSync            fs.lchown
fs.lchownSync            fs.link                  fs.linkSync              fs.lstat                 fs.lstatSync
fs.mkdir                 fs.mkdirSync             fs.mkdtemp               fs.mkdtempSync           fs.open
fs.openSync              fs.read                  fs.readFile                        fs.readSync
fs.readdir               fs.readdirSync           fs.readlink              fs.readlinkSync          fs.realpath
fs.realpathSync          fs.rename                fs.renameSync            fs.rmdir                 fs.rmdirSync
fs.stat                  fs.statSync              fs.symlink               fs.symlinkSync           fs.truncate
fs.truncateSync          fs.unlink                fs.unlinkSync            fs.unwatchFile           fs.utimes
fs.utimesSync            fs.watch                 fs.watchFile             fs.write                 fs.writeFile
fs.writeFileSync         fs.writeSync