-
Cool stackoverflow post about defining js objects and when to use one.
-
Conversion Tricks: http://samuli.hakoniemi.net/
var myVar = "3.14159", str = ""+ myVar,// to string int = ~~myVar, // to integer float = 1*myVar, // to float bool = !!myVar, /* to boolean - any string with length and any number except 0 are true */
-
Create an empty file: http://stackoverflow.com/questions/12809068/create-an-empty-file-in-nodejs
var fs = require('fs'); fs.closeSync(fs.openSync(filepath, 'w'));
-
Append to a file: http://stackoverflow.com/questions/3459476/how-to-append-to-a-file-in-node
var fs = require('fs'); fs.appendFile('message.txt', 'data to append', function (err) { //Error handling or other info. });
-
Delete a file: https://nodejs.org/api/fs.html#fs_file_system
var fs = require('fs'); fs.unlink('/tmp/hello', function (err) { if (err) throw err; console.log('successfully deleted /tmp/hello'); });