background preloader

Articles/Etc | node.js

Facebook Twitter

Websockets and More - 20 awesome node.js npm modules we use every day | BeyondFog. Blazing fast node.js: 10 performance tips from LinkedIn Mobile. In a previous post, we discussed how we test LinkedIn's mobile stack, including our Node.js mobile server. Today, we’ll tell you how we make this mobile server fast. Here are our top 10 performance takeaways for working with Node.js: 1. Avoid synchronous code By design, Node.js is single threaded. Unfortunately, it is still possible to make synchronous/blocking calls. Our initial logging implementation accidentally included a synchronous call to write to disc. 2.

The Node.js http client automatically uses socket pooling: by default, this limits you to 5 sockets per host. 3. For static assets, such as CSS and images, use a standard webserver instead of Node.js. 4. Let's quickly compare rendering a page server-side vs. client-side. Note that everything on this page, except for the user's name, is static: that is, it's identical for every user and page reload. The rest of the page - all the static HTML markup - can be put into a JavaScript template (such as an underscore.js template): 5. 6. Felix's Node.js Convincing the boss guide. « Home / All Guides Now that you're all hyped up about using node.js, it's time to convince your boss. Well, maybe. I have had the pleasure of consulting for different businesses on whether node.js is the right technology, and sometimes the answer is simply no.

So this guide is my opinionated collection of advice for those of you that want to explore whether node.js makes sense for their business, and if so, how to convince the management. Bad Use Cases CPU heavy apps Even though I love node.js, there are several use cases where it simply doesn't make sense. That being said, node.js allows you to easily write C++ addons, so you could certainly use it as a scripting engine on top of your super-secret algorithms. Simple CRUD / HTML apps While node.js will eventually be a fun tool for writing all kinds of web applications, you shouldn't expect it to provide you with more benefits than PHP, Ruby or Python at this point.

NoSQL + Node.js + Buzzword Bullshit Good Use Cases JSON APIs Single page apps. 6 Must Have Node.js Modulesblog. So you're thinking about using node.js: awesome. If you're new to the community you're probably thinking "what's the best node.js module / library for X? " I think it's really true when experienced language gurus say "80% of your favorite language is your favorite library. " This is the first in a series of articles will give you a high-level overview of some of our favorite node.js libraries at Nodejitsu.

Today we'll take a look at these libraries: cradle: A high-level, caching, CouchDB library for Node.js findit: Walk a directory tree in node.js node_redis: Redis client for node node-static: RFC2616 compliant HTTP static-file server module, with built-in caching. optimist: Light-weight option parsing for node.js xml2js: Simple XML to JavaScript object converter. If you're using CouchDB you should be using cradle. A common set of problems that I see on the nodejs mailing list are advanced file system operations: watching all the files in a directory, enumerating an entire directory, etc. Use Node.js as a full cloud environment development stack. As technology innovation continues to advance at a seemingly exponential rate, new ideas arise from day one that just make sense. Server-side JavaScript is one of those ideas. Node.js, an event-driven I/O framework for the version 8 JavaScript engine on UNIX-like platforms, intended for writing scalable network programs such as web servers, is the execution of that good idea.

Instead of fighting JavaScript, Node.js embraces it as the full development stack, from server-side code all the way to the browser. Node.js also embraces another innovative idea: The concurrency model involving asynchronous I/O through callbacks. Node.js cloud platforms A significant benefit to using the Node.js framework arises when you use it in a cloud environment. Figure 1. Recently, an exciting open source project, Cloud Foundry, released the code to create a private PaaS that is capable of running Node.js. Back to top Using the Node.js shell The toUpperCasemethod looks interesting to try. Var sockets = []; 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.

For client-side web development, it is possibly the most widely used language in the world. JavaScript also has a place in server-side scripting, and that niche is growing. While there have been attempts at server-side JavaScript in the past, none has seemingly captured as much excitement as Node.js, or Node. 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. Node's event-driven concurrency Test it! How To Node - NodeJS. JavaScript on the server: Growing the Node.js Community. Cloud9 IDE and Mozilla have been working together ever since their Bespin and ACE projects joined forces. Both organizations are committed to the success of Node.js, Mozilla due to its history with Javascript and Cloud9 IDE as a core contributor to Node.js and provider of the leading Node.js IDE.

As part of this cooperation, this is a guest post written by Ruben Daniels and Zef Hemel of Cloud9 IDE. Netscape Enterprise Server is the first web server to support the Java(TM) and JavaScript(TM) programming languages, enabling the creation, delivery and management of live online applications. This is how the web got started, all the way back in the mid-nineties. Sadly, it was not meant to be then. JavaScript on the server failed, while JavaScript in the browser became a hit. Still, there are two obvious advantages that support this idea of using JavaScript not only in the browser, but on the server as well: Skill reuse. A New Hope Then, Node.js happened. Programming with threads is hard.