Alex Bosworth's Weblog

developing software, living the expat life in beijing, other fun stuff!

previous projects: alchemy, swik, open source stuff, now adylitica.

Switching to Node.js

Although it’s still very new, I’m confident now that Node.js represents a changing point in web application development and the line blurs between front end and backend development. 

I’ve been porting my http://tweetbe.at/ code over to run on Node, and it’s not seamless as Node.js is still a different environment, but my end goal is to merge the two worlds and write client code and server code at the same time.

Node still has many flaws, but they are the kind of flaws that the developer in me likes to see: problems that require interesting work to solve, and the realization that this is the future and eventually the problems will give way to an overall better solution.

I’ve started work on various pieces of code to bridge the gaps in node’s still nascent libraries. One thing I’ve been working on is a port of jQuery to Node.js. The idea here is that if you do $.getJSON() in a function on your client, you should be able to do that in your Node code as well.

The issue though is that Node has no XMLHTTPRequest (obviously, since it can just make normal HTTPRequests), so I have had to clone XMLHTTPRequest. There are many other issues and I am not done yet, but my goal is to be able to do var $ = require(‘node-jquery’) and have all the same jQuery functionality I depend on in web javascript.

If you are interested you can see the code on github here: http://bit.ly/node-jquery

Another thing that keeps me interested and loving JavaScript is that the basic language is so abstract, there are a lot of different ways to do things, and no clear answer on what is the best. Generally what I hope to see out of the node.js community is the practicality of jQuery come through, a balance of ‘optimize for the most common tasks’ with ‘dont push the language too crazily far’.

Another piece of code I’ve been working on is a simple Amazon S3 library for node. I use S3 a lot instead of going to disk, because it’s reliable, affordable, scalable, and I never want to rely on a single machine. I have had my issues with Amazon SimpleDb, but I want to go back to it and I may do a node.js library for it.

If you want to check out how my amazon s3 project is coming by the way, the code is on github here: http://bit.ly/amazon-s3  

Comments (View)
blog comments powered by Disqus