Quantcast
Channel: How To Node
Browsing all 134 articles
Browse latest View live

How To Module

These are some basic steps for writing a NodeJS module.Most of the suggestions in this document are optional. You can definitely write your program however you like, and many in the node community...

View Article


Fun Putting Node on Mobile Devices

This article will walk you through creating an Ubuntu image that can be chrooted inside a mobile device like the recently released TouchPad. Once the Ubuntu environment is setup we'll learn how to...

View Article


A Simple Blog with CouchDB, Bogart, and Node.js

Update: By request I have posted a gist of the app.js using MongoDB instead of CouchDB. This gist also serves as a beginning example for how to use non-promise-based APIs with bogart.In this article,...

View Article

Managing module dependencies

Following this discussion on the node.js mailing list about managing module dependencies, I thought it's worth sharing some pointers on that here.Using NPM to bundle your module dependenciesIf you're...

View Article

Easy HTTP Mock Testing with Nock and node-tap

One of my first node.js libraries was nano: A no fuss CouchDB client based on the super pervasive request. In foresight that was a good idea, even though there's a ton of clients for CouchDB none of...

View Article


Asynchronous Control Flow with Promises

A Promise is an object that represents the result of an asynchronous function call. Promises are also called futures and deferreds in some communities.Goal of this ArticleThe goal of this article is to...

View Article

Testing Private State and Mocking Dependencies

During Christmas I've been working on Testacular and found some tricks how to make my testing life easier. It's nothing special at all, just a simple way how to access private state of a module and how...

View Article

Understanding process.nextTick()

I have seen quite a few people being confused about process.nextTick(). Let's take a look at what process.nextTick() does, and when to use it.As you might already know, every Node application runs on a...

View Article


Really simple file uploads with Express

Few days ago I was working on a fairly typical web application and I faced the challenge of implementing a fairly typical web application feature - file uploads. It was the first time I was...

View Article


Node.js and MongoDB - Getting started with MongoJS

It won't be an exaggeration if one claims that in the past few months Node.js and MongoDB have literally taken the software and web industries by storm.Not just bleeding-edge startups but even medium...

View Article

Sending e-mails with Node and NodeMailer

Sending e-mails with NodeJS is almost a breeze. Almost. First, you have to plug-in the NodeMailer module than set up a transport type, load the templates, add attachments and finally send...The CodeThe...

View Article

Make Your Tests Deterministic

Non-deterministic issues like race conditions or thread deadlocks are very difficult to test, because they are by nature hard to reproduce. Fortunately, in the JavaScript world, we only have a single...

View Article

Session-based Authorization with Socket.IO

Finding a decent article about session based authorization in socket.io is more difficult than one expected. This article will show how you can take advantage of Express session middleware and...

View Article


Content Syndication with Node.js

Web syndication is a must for any Website wishing to share some entries easily to other systems. Better known under their format name like RSS) or Atom), they can be quite time consuming to generate...

View Article

Daddy, what's a stream?

At dinner tonight, I was discussing that I've been thinking about streams and how to simplify them in JavaScript. My 7-year-old perked up and asked me:Daddy, what's a stream?I explained that a stream...

View Article


Image may be NSFW.
Clik here to view.

Simplifying Chores with Grunt

Often in various stages of development we perform repetitive tasks e.g minification, compilation, unit testing, linting and we would definitely want to automate them. But each of these task require...

View Article

Generators vs Fibers

Both ES6 generators and node-fibers can be used to block a coroutine while waiting on some I/O without blocking the entire process.This means that you can wait for an I/O result within your code but...

View Article


Mocking Dependencies using [rewire]

Despite all my efforts to try to encapsulate some of my code into my modules, I was always founding myself exposing too much just for unit testing purpose. And even thought, it was often very complex...

View Article

Solving Coding Challenges with Streams

My first experience using Node.js for a programming challenge was agonizing. I devised a viable solution, but I couldn’t figure out an effective way to parse the input. The format was painfully simple:...

View Article

Control Flow in Node

One of the unique aspects of programming in an async framework like node is the ability to decide between which function will run in serial and which will run in parallel. While there are no built-in...

View Article
Browsing all 134 articles
Browse latest View live