Write programs that do one thing and do it well.
CommonJS is known for giving JavaScript a module system, while Node is what gave JavaScript systems-level access
CommonJS gave JavaScript packages. With packages, the next thing JavaScript needed was a package manager. Node provided one with npm.
Avoid mixing types in arrays. It is always better to have a consistent data type, such as all integers or all strings. As well, avoid changing types in arrays, or in property assignments after initialization if possible.
Try to avoid adding properties after an object is instantiated. Initialize all members in constructor functions in the same order. Same properties + same order = same object.
This way of keeping the execution of a function together with the environment the function runs in is called closure.
Inside Node, a C library named libuv creates and manages the event loop. It connects to low-level operating system kernel mode objects that can produce events, such as timers that go off, sockets that receive data, files that open for reading, and child processes that complete. It loops while there are still events to process, and calls callbacks associated with events. It does this at a very low level, and with a very performant architecture. Written for Node, libuv is now a building block of a number of software platforms and languages.
"The best way to predict the future is to invent it." – Alan Kay
Eliminating blocking processes through the use of event-driven, asynchronous I/O is Node's primary organizational principle.

results matching ""

    No results matching ""