node.js - Debuggable Ltd Posted on 24/9/09 by Felix Geisendörfer What happens if you take an insanely fast JavaScript engine and build an asynchronous I/O library around it? You get node.js, an up and coming project that brings you bloat-free server-side JavaScript. This enables you to write any kind of "backend" service with just a few lines of JavaScript. This code creates a new http server and tells it to listen on port 8000. However, during those 2 seconds the server will continue to accept new connections. Here is another chart from a req/sec benchmark among various server-side JS libs: Now you may think this is all very nice and stuff, but what do you actually need it for? Trying out node.js requires you to have a Linux/Unix machine but it's pretty much as simple as downloading the code and running: . The documentation is pretty excellent and there are lots of friendly people on the mailing list to help if you have any problems. I'd love to hear your thoughts on node.js and any questions you might have.
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
Curso de Introducción a node.js Curso de Introducción a node.js diciembre.19 Archivo de videos Descargar MP3s Luego del éxito del curso de Introducción a HTML5 el jueves 15 dimos un curso de introducción a node.js en vivo. Alrededor de 2000 personas en simultáneo disfrutaron del programa y tuvieron la oportunidad de adentrarse y aprender más del interesante mundo de node.js. Antes y después del programa @cvander estuvo compartiendo interesantes lecturas para sumergirnos en el mundo node.js de lleno: La expectativa y la repercusión del curso se hicieron notar a través de tweets que puedes ver en el storify del Resumen de la Introducción a node.js, así como los comentarios en la fanpage de #mejorandola en facebook. Entra con Twitter Entra con Facebook 14 Comentarios hola / enero.29 blabla Matts / enero.04 sticchimatias.com.ar Aca hay una referencia muy completa de javascript: Esta en ingles pero es muy tecnico y sencillo de entender. Bumiga / enero.04 luli / diciembre.28 cdr / diciembre.21 Doctore
Debugger Node.js v0.10.17 Manual Stability: 3 - Stable V8 comes with an extensive debugger which is accessible out-of-process via a simple TCP protocol. Node has a built-in client for this debugger. To use this, start Node with the debug argument; a prompt will appear: % node debug myscript.js < debugger listening on port 5858 connecting... ok break in /home/indutny/Code/git/indutny/myscript.js:1 1 x = 5; 2 setTimeout(function () { 3 debugger; debug> Node's debugger client doesn't support the full range of commands, but simple step and inspection is possible. For example, suppose myscript.js looked like this: x = 5;setTimeout(function () { debugger; console.log("world");}, 1000); console.log("hello"); Then once the debugger is run, it will break on line 4. The repl command allows you to evaluate code remotely. Watchers# You can watch expression and variable values while debugging your code. To start watching an expression, type watch("my_expression"). watchers prints the active watchers. Commands reference# Stepping# % . Info#
Diving into Node.js – Introduction & Installation Why I Need Something Like Node.js? First of all the use of some software is needed not because of itself, but because of the need of some specific functionality. In my case this was the need of real time news feed. Introducing Node.js Perhaps the best way do describe what is Node.js is from its about page. Node’s goal is to provide an easy way to build scalable network programs. In general Node is a program using the Google Chrome’s V8 JavaScript engine, which in turn is a program that can parse and execute code written in JavaScript. Such kind of application/server is Node.js. The way Node works, however is different from what we know from every other web server. Whenever a request comes to the server, it tries to return the response as fast as possible. Here the server doesn’t return immediately the response, but holds as long as possible until some “event” occurs. Typically this scenario can be simulated without Node, but as I said, with some disadvantages. Installing Node.js Summary
The Changelog If you hadn’t heard, JSON API is a format for building awesome APIs on top of JSON. You can see other posts tagged with JSON API here. Recently, a new project related to JSON API was released: Fortune.js. Fortune.js, a web framework for prototyping rich hypermedia APIs, allows you to rapidly prototype the server side of any JSON API api. Check it out: This will give you all the proper routes and format the responses in the right way to conform with the spec. If you didn’t guess, fortune.js makes heavy use of Node, so you can get it from npm: $ npm install fortune I am super pumped about projects like this, because it shows off the great benefits of standardizing around a type like JSON API.
How to write your own native Node.js extension - Olivier Lalonde's blog UPDATE: There is now a Node.js addon for loading and calling dynamic libraries using pure JavaScript: node-ffi. Also, node-waf is no longer being used to compile Node.js extensions. TRANSLATIONS: This post was translated to Chinese: Introduction This is a follow up to How to roll out your own Javascript API with V8. We will now port the code we have written for V8 to Node.js and package it for npm. The full source code of this tutorial is available from github: git clone You can also install it through npm: npm install notify The code was tested on Ubuntu 10.10 64-bit and Node.js v0.5.0-pre. Getting started First let’s create a node-notify folder and with the following directory structure. This fine looking tree was generated with the tree utility. Now let’s create our test script demo.js and decide upfront what our extension’s API should look like: Writing our Node.js extension
El Libro para Principiantes en Node.js» Un tutorial completo de node.js Sobre el Tutorial El objetivo de este documento es ayudarte a empezar con el desarrollo de aplicaciones para Node.js, enseñándote todo lo que necesites saber acerca de JavaScript "avanzado" sobre la marcha. Este tutorial va mucho más allá del típico manual "Hola Mundo". Status Estás leyendo la versión final de este libro, es decir, las actualizaciones solo serán hechas para corregir errores o para reflejar cambiar en nuevas versiones de Node.js. Las muestras de código de este libro están probadas para funcionar con la versión 0.6.11 de Node.js. Audiencia Objetivo Este documento probablemente será mejor entendido por los lectores que tengan un trasfondo similar al mío: Programadores experimentados en al menos un lenguaje orientado al objeto, como Ruby, Python, PHP o Java; poca experiencia con JavaScript, y ninguna experiencia en Node.js. Estructura de este documento Empezaremos por mirar cómo el desarrollo en JavaScript en Node.js es diferente del desarrollo en JavaScript en un browser. Ok.
Using Express.js for APIs | StrongLoop A few tips and libraries for creating and documenting RESTful APIs with Express.js. See a simple example app that incorporates some of these ideas. Two things really got me sucked into Express when I first started using it: Jade and Stylus. I can barely tolerate writing HTML and CSS any other way. These days I spend more time using Express for APIs that send nothing but JSON. Mongoose I’m assuming an API backed by MongoDB, and that we’re using Mongoose. express-mongoose I’m generally not a flow control library guy. The fact that it supports Promises is important to keep in mind, because it means you can create some fairly complex async stuff in your Mongoose models, and as long as it returns a Promise you keep the top layer routing/sending code really tidy. Mongoose Transforms I often find myself wanting to hide certain properties before they get sent across the wire. This is yet another way to avoid repetition at the route/controller levels of your app. Routing express-resource-new or