Frontend developers picking up Node.js still need to brush up on some server-side knowledge.
Frontend developers picking up Node.js still need to brush up on some server-side knowledge.
Notes on Maintainable JavaScript
Part one covers coding style to make team code look as if written by a single person. Part two covers programming practices, with many valuable JavaScript programming lessons. Part three is about automation, but the toolchain it introduces feels quite outdated by the end of 2016.
Notes on JavaScript: The Good Parts
I recently bought a few books, and this “JavaScript: The Good Parts” truly lives up to its name. It’s short in length with extensive appendices. The author is Douglas Crockford, the inventor of JSON – sounds impressive, and indeed the book is packed with insights. I benefited greatly from reading it!
Node.js Development Guide - Book Notes
Single Loading:
require does not load modules repeatedly. No matter how many times require is called, the module obtained is always the same one.
Overriding exports:
When encapsulating an object into a module, using exports.Hello = Hello requires require(‘./singleobject’).Hello to obtain the object. This can be simplified as follows: module.exports = Hello; Then you can directly obtain the object: var Hello = require(‘./hello’); hello = new Hello();
Creating Global Links:
npm link express; This allows you to use the globally installed express in the current directory.
Use npm init to interactively initialize a standard package.json;
Publish a package: npm publish;
After modifying the version field in the json file, republish to update the version;
Unpublish: npm unpublish;
Excerpts from Functional Programming in JavaScript
Notes on JavaScript: The Definitive Guide
NaN, while null converted to number: 0, empty string converts to 0 and false.