Posts tagged with code


Here is the simple chunk of code to replace a particular section in a file asynchronously. fs.readFile(filePath, 'utf8', function(err, data) { if (err) { return console.log(err); } var result = data.replace(your-regex-or-text,replacement-text)…

ECMAScript5 features now supported by all browser vendors. Almost every time I forget that many handy functions are introduced in ES5 and I don’t need to write utility functions for it. So I feel…