Node.js Tutorial With Socket.io – Daniel Nill I was shocked to recently discover that there are no great quick tutorial on the basics of using socket.io with node js. While there isn’t a whole lot to it, someone not familiar with node.js and the protocol for WebSockets is left to scrounge for random snippets of code. Trying to parse the protocol of Websockets while learning the socket.io library and the basics of Node.js all at the same time is no easy feat. So I thought I would take a brief stab at filling this void. What We Will Cover: In this tutorial we will cover setting up a Node.js server and router (You can find this many places but it is a necessary first step) connecting socket.io to this server sending data to the client through the socket connection sending data to the server through the socket connection Your Basic Server: There are several modules you can use to initiate a server in Node.js, but they are all pretty much the same. var http = require('http'); var server = http.createServer(); server.listen(8001);
Streams in JavaScript: a versatile Tool - codecentric Blog Streams in Node.js are an important and versatile Tool. Unix Pipes were an example for Streams. At the beginning they were just representations of byte sequences or strings, built to improve the efficiency of the internals of Node.js, especially the parsers. What is a Stream? A Stream is an abstraction of a sequence of data, which is distributed in time. Streams have a few properties we have to consider when working with them. A Stream in Node.js can be readable, writable or both, which we call Duplex stream. Streams are versatile Well, how can we use streams? In this code, a file is read with a Readable stream and processed chunk-by-chunk. Now we can see an important strength of streams: they are highly combinable. Because streams are really sequences, they can be processed very similarly to arrays and lists. So you can export a stream, or a factory function which returns a stream, to make your module seamlessly cooperate with others. Streams and Functional Programming Int -> Int -> Int
Node.js for Java developers JavaScript has over the past few years emerged as an under-sung hero of web application development. This recognition has been often met by surprise from software developers accustomed to dismissing JavaScript as a "toy language." While there are more popular languages (in the sense that developers clamor to announce their allegiance to them), JavaScript's unique status as the standard, browser-neutral scripting language has lent it staying power. JavaScript also has a place in server-side scripting, and that niche is growing. Designed to assist developers in building scalable network programs, Node is a server-side programming environment that has virtually reinvented JavaScript for a whole new generation of developers. In this article, I introduce you to the server-side scripting revolution that is Node. Node's event-driven concurrency Node is a scalable, event-driven I/O environment built on top of Google's V8 JavaScript engine. Concurrency just works in Node programs. Back to top
krakenjs/lusca Koa - next generation web framework for node.js nodeschool.io NodeJS et Cassandra - Meetup Pour ce NodeJS Paris S02E02, nous avons eu le droit aux joli amphis de l'école 42, avec ses poufs multicolores (et inconfortables). Pas de dossier, donc pas très pratique de prendre des notes. Comme d'hab, on rappelle le but du meetup (on parle de javascript en général, et de node en particulier). Présentation du site web, de comment proposer des talks, etc, etc. Puis se sont enchainés plein de sponsors, beaucoup trop. En vrac, Marceau Innovation (qui n'a pas beaucoup innové pour trouvé son nom) qui aide des français à partir s'installer à la Silicon Valley. On a quand même ensuite pu commencer les choses sérieuses, et tant mieux car le programme était très intéressant : Cassandra, Testing Asynchronously, Breaz.io et Freelance Academy. Cassandra Présentation de Duy Hai Doan, évangéliste chez Datastax, l'éditeur de Cassandra. Donc Cassandra, ou C* pour les intimes, a été créé chez Facebook avant d'être open-sourcée en 2008. Autre avantage mis en avant : la simplicité opérationnelle.