background preloader

NodeJS

Facebook Twitter

The Node Beginner Book » A comprehensive Node.js tutorial. About The aim of this document is to get you started with developing applications with Node.js, teaching you everything you need to know about "advanced" JavaScript along the way. It goes way beyond your typical "Hello World" tutorial. Status You are reading the final version of this book, i.e., updates are only done to correct errors or to reflect changes in new versions of Node.js. It was last updated on July 1, 2013. The code samples in this book are tested to work with Node.js version 0.10.12. This site allows you to read pages 1-21 of this book for free.

Intended audience This document will probably fit best for readers that have a background similar to my own: experienced with at least one object-oriented language like Ruby, Python, PHP or Java, only little experience with JavaScript, and completely new to Node.js. However, because functions and objects in JavaScript are different from their counterparts in most other languages, these will be explained in more detail. Table of contents. Useful Node.js Tools, Tutorials And Resources. Advertisement Created by Ryan Dahl in 2009, Node.js is a relatively new technology which has gained a lot of popularity among Web developers recently. However, not everyone knows what it really is. Node.js is essentially a server-side JavaScript environment that uses an asynchronous event-driven model. What this means is simple: it’s an environment which is intended for writing scalable, high performance network applications. It’s like Ruby’s Event Machine or Python’s Twisted, but it takes the event model a bit further—it presents the event loop as a language construct instead of as a library.

And that’s not all: what’s really great about Node.js is the thousands of modules available for any purpose, as well as the vibrant community behind this young project. Useful Node.js Tools Socket.IO Socket.IO is a cross-browser Web socket that aims to make real-time apps possible in every browser and mobile device, blurring the distinctions between the various transport mechanisms. Related Posts. Inversion of Control Containers and the Dependency Injection pattern. In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of "Inversion of Control". In this article I dig into how this pattern works, under the more specific name of "Dependency Injection", and contrast it with the Service Locator alternative.

The choice between them is less important than the principle of separating configuration from use. One of the entertaining things about the enterprise Java world is the huge amount of activity in building alternatives to the mainstream J2EE technologies, much of it happening in open source. A lot of this is a reaction to the heavyweight complexity in the mainstream J2EE world, but much of it is also exploring alternatives and coming up with creative ideas.

Components and Services A Naive Example class MovieLister... Node.js : le livre du débutant. JavaScript et vous▲ Avant de rentrer dans les détails techniques, prenons un moment pour parler de vous et de votre rapport avec JavaScript. Ce chapitre va vous servir à déterminer s'il vous est utile de continuer la lecture de ce livre. Si vous êtes comme moi, vous avez commencé le développement Web il y a quelques années en écrivant des pages HTML. Vous avez commencé à utiliser cette chose étrange appelée JavaScript, mais juste pour ajouter un peu d'interactivité ici ou là. Ce que vous vouliez était surtout apprendre à créer des pages Web complexes ; vous avez donc appris des langages comme PHP, Ruby, Java pour écrire du code serveur. Malgré tout, vous avez gardé un œil sur JavaScript et avez découvert, avec l'apparition de jQuery, Prototype ou autres bibliothèques, que JavaScript pouvait réaliser des choses avancées, bien au-delà de simples window.open().

Puis vint Node.js : du JavaScript côté serveur ! Vous avez donc décidé de vous intéresser aux nouveautés de ce vieux JavaScript. Advanced Web Applications With Object-Oriented JavaScript. Recently I interviewed a software developer with five years experience in developing Web applications. She’d been doing JavaScript for four and a half years, she rated her JavaScript skill as very good, and—as I found out soon after—she actually knew very little about JavaScript. I didn’t really blame her for that, though. JavaScript is funny that way. It’s the language a lot of people (including myself, until recently!) In a way, that assumption is not entirely groundless. Indeed, until recently, I’d always been able to get by with whatever little JavaScript I knew, armed only with the MSDN® DHTML reference and my C++/C# experience.

Object-oriented programming (OOP) is one popular approach that’s used in many JavaScript libraries to make a codebase more manageable and maintainable. JavaScript Objects Are Dictionaries In C++ or C#, when we’re talking about objects, we’re referring to instances of classes or structs. Does exactly the same thing as this: OK, so what’s happening here?