Eventually Consistent

Dispatches from the grey area between correct and working

Node Posts

8 posts found

node

Streams

Touted as Node.js's best feature, streams are also one of the hardest to comprehend. Some of the mystique that surrounds streams is the lack of good documentation; there are plenty of online examples that show how to use pre-built stream objects (like and http request) but less on how to create custom stream objects that work within an application.

Read more
node

Node MySQL

Quick and dirty MySQL hacks: Check one tables entries against a join table, user a subquery in a where, check if an entry exists without actually checking, make a quick array with group_concat

Read more
node

Building an Express Blog Application

I'm in the process of rewiring the backend for Ethernet Bucket using Express. If you don't know what express is, here's a good primer. The goal today is to write something that can take blog entries in MongoDB (that part not covered) and turn them into web pages.

Read more
node

APIs with Node

With a little work, node can be used as a complete web server, but it's probably something you shouldn't do. Node's speed is limited when it comes to traditional web-server applications because it runs inside an interpreter (like all javascript) and just wont be as as fast at things like reading from disk.

Read more
node

HTTP Handler Function

A good jumping-off-point when writing your node server is to use a handler function to route all HTTP requests to their proper functions. If you write functions that are specific to a url such as providing a web service that reads from a database and then writes back XML or JSON you can use an if-else block or a switch block to route the request to the function.

Read more
node

Node Server

As a web developer, building a node server has a lot of value not only in terms of gaining node programming skill, but also in understanding how web servers and fundamental web technologies such as HTTP work.

Read more