background preloader

The Node Beginner Book

The Node Beginner Book

Scraping the web with | Coderholic is a relatively new screen scraping framework that allows you to easily scrape data from websites using Javascript, a language that I think is perfectly suited to the task. It's built on top of Node.js, but you don't need to know any Node.js to get started, and can run your jobs straight from the command line. The existing documentation is pretty good, and includes a few detailed examples, such as the one below that returns the number of google search results for some given keywords: Running this from the command line gives you the following output: $ google.js hello has about 878,000,000 results foobar has about 2,630,000 results weather has about 719,000,000 results OK: Job complete Scraping Multiple Pages Unfortunately some of the documentation simply says coming soon, so you're left to guess the best way to put together more advanced scraping workflows. While my solution works I'm sure it's not optimal. There's lots more than can do.

Running node.js on Windows with VirtualBox and Ubuntu | Chris Fulstow Introduction Node.js is an event-driven I/O framework for building extremely fast and scalable network applications. It's designed to run on Unix-like platforms, and although it's possible to run node.js on Windows , it's not yet fully supported. There's a Windows port of node.js in the pipeline, but in the meantime if you're a Windows user who wants to check out the node.js hype, this article shows you how to run node.js inside your own Linux virtual machine. For a deeper introduction to node.js, watch this Introduction to NodeJS video or read the The Node Beginner Book . We'll start off by installing and configuring VirtualBox, set up a shared folder between Windows and the VM, install Git, node.js and NPM, then finally write a simple web server. Install VirtualBox The first step is to download and install VirtualBox , an open source virtualisation application that lets you run Linux inside Windows. Create and a new Linux virtual machine Storage Network Install Ubuntu $ sudo apt-get update

Nuno's Notebook — nano - minimalistic CouchDB client for nodejs Motivation In some of my nodejs projects I was using request to connect to CouchDB. As Mikeal Rogers, the author of request, would have said CouchDB and nodejs are a perfect fit. I would argue that request is the perfect glue to binds nodejs and CouchDB together. One of the coolest things about request is that you can even proxy request from CouchDB directly to your end user using nodejs stream#pipe functionality. After doing development like this for a while some obvious patterns started to emerge, as well as some code duplication. The result is a very clean code base based entirely on request. Show me the code For your convenience I added all the code snippets to a gist. You can install nano using npm: mkdir nano_sample && cd nano_sample npm install nano If you don't have CouchDB installed I would recommend using Iris Couch. Now we can give nano a try: node var nano = require('nano')(' nano; This makes it super easy for someone that knows CouchDB to use nano.

6 Free E-Books and Tutorials for Learning and Mastering Node.js OK, we won't bore you by telling you what Node.js is again or why it's so dang hot. You want to learn Node.js? There's no completely finished Node.js book out there that we're aware of. But there's one complete book in rough draft form, two partial guides and several other great resources for learning Node.js. No more excuses: Try Node.js for $0.02 or less in just a few minutes No more excuses: Try Node.js for $0.02 or less in just a few minutes is a short tutorial from the developers of NowJS. Up and Running With Node.js Up and Running with Node.js by Tom Hughes-Croucher hasn't been officially released yet, but O'Reilly Media has released a free text preview of the book as part of its Open Feedback Publishing System. Our previous coverage of the book is here. The Node Beginner Book The Node Beginner Book by by Manuel Kiessling is a new Node.js e-book. Felix's Node.js Guide Felix's Node.js Guide got a lot of attention this week, particularly the Convincing The Boss section. Mastering Node

Learning Node.js « JTeam Blog / JTeam: Enterprise Java, Open Source, software solutions, Amsterdam For projects and for some experiments I want to get a better way to do server push. With the new HTML 5 becoming the standard and therefore WebSockets becoming available in all mayor browsers, it seems that WebSockets is the way forward. A very nice implementation of WebSockets that is backwards compatible with older browsers is available through Within this blog post I want to share some of the things I learned while creating a sample application. In my previous post on gridshore I wrote about Node.js. The sample The sample I am creating is just to show of some features of Node.js. The sample mainly focusses on a chat application. Introducing Node.js Node.js is all about efficiently handling request. Node.js can be used with a package manager called npm. Building or installing Installation of node is not hard of you do not need the latest and greatest and you are not developing using windows. > git clone > cd node > .

vm - Node.js Manual Executing JavaScript You can access this module with: var vm = require('vm'); JavaScript code can be compiled and run immediately or compiled, saved, and run later. vm.runInThisContext(code, [filename]) vm.runInThisContext() compiles code as if it were loaded from filename, runs it and returns the result. Example of using vm.runInThisContext and eval to run the same code: var localVar = 123, usingscript, evaled, vm = require('vm'); usingscript = vm.runInThisContext('localVar = 1;', 'myfile.vm'); console.log('localVar: ' + localVar + ', usingscript: ' + usingscript); evaled = eval('localVar = 1;'); console.log('localVar: ' + localVar + ', evaled: ' + evaled); vm.runInThisContext does not have access to the local scope, so localVar is unchanged. eval does have access to the local scope, so localVar is changed. In case of syntax error in code, vm.runInThisContext emits the syntax error to stderr and exception. vm.runInNewContext(code, [sandbox], [filename]) script.runInThisContext()

We open-sourced 90 node.js modules at Browserling! At Browserling we are huge open-source fans and we have open-sourced 90 node.js modules! That's right! 90 node.js modules. Here is the complete list of all the modules together with their brief descriptions. We'd love if you followed us on GitHub. Also check out Browserling: And read how we raised $55,000 seed funding for Browserling. Here are all the modules we have written. 1. dnode DNode is an asynchronous object-oriented RPC system for node.js that lets you call remote functions. This starts dnode server on port 5050 and exports the zing function that asynchronously multiplies number n by 100. And you have your client.js: var dnode = require('dnode'); dnode.connect(5050, function (remote) { remote.zing(66, function (n) { console.log('n = ' + n); });}); This connects to dnode server at port 5050, calls the zing method and passes it a callback function that then gets called from the server and the client outputs 6600. dnode on github 2. node-browserify Here are the node-browserify features: $ .

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

MapRejuice | Distributed Computing via Javascript Node.js in Action Node.js in Action is an example-driven tutorial that starts at square one and guides you through all the features, techniques, and concepts you'll need to build production-quality Node applications. You'll start by learning how to set up your Node development environment, including loading the community-created extensions. Next, you'll run several simple demonstration programs where you'll learn the basics of a few common types of Node applications. Then you'll dive into asynchronous programming, a model Node leverages to lessen application bottlenecks. JavaScript on the server? Node.js in Action shows you how to build production-quality applications. What's Inside Set up Node and extensions Grok asynchronous programming and the event loop Examples including microblogging, IM, games, and more About the Authors As skilled practitioners, expert teachers and trainers, and contributors to the core framework, authors Mike Cantelon, Marc Harter, T.J.