igrat

FacebookTwitter

Javascript

Version française You are about to download a document protected by copyright law in your country. The unauthorized reproduction or distribution of this copyrighted work is illegal and may be punishable by criminal law. http://standards.iso.org/ittf/licence.html
http://blog.mixu.net/2011/02/02/essential-node-js-patterns-and-snippets/

Essential Node.js patterns and snippets « Mixu's tech blog

In this post, I take a look at the different patterns that you need to know when using Node.js. These came from my own coding and from a look at the code behind Tim Caswell’s flow control libraries. I think it is necessary to know how these basic patterns are implemented even if you use a library.. 1.1 Class pattern If the class is long, then instead of doing a single Class.prototype = {…} assignment, it may be split into multiple Class.prototype.method = function () {..} assignments. Reminder : Assign all your properties some value in your constructor.