Creating command line tools with Node.js
I needed to create an utility that when installed as a global module, it would be both available as a command line tool in bash and as a Node module that could be imported with require function from any Node script. As the command line tool, i wanted it to take input in two ways: take parameters and read input from a file or take piped streams. This tip explains how this can be achieved.

One of the first things I had to learn when starting developing JavaScript applications was how to overcome lack of dependency management and concept of modules and namespaces. Unfortunately there are few JS books touching on these topics. When building large scale application, implementing hundreds of <script> tags becomes really hard to manage, especially when we need to keep them in specific order. Also the more script tags are included in the html files, the more requests a browser needs to do - this may cause a significant impact to the overall user experience - loading times, UI freezes... As JS lately became a language of choice for developing web applications targeting not only desktops but also mobile devices, developers needed to find a solution for that. Instead of waiting for changes to the JS specification (
Box2D probably doesn't have to be introduced to anyone, even if you have never used it, you have probably still heard about it. This is the most popular physics simulation engine that has been ported to every popular platform available. I had a chance to work with Box2D in C++ and I have been reading tutorials from guys using it with Python, Objective-C, Java and JavaScript. So if you come from other platform than Flash, I encourage you to read this article anyway as although I'm using a Flash port here, everything works exactly the same way in other platforms. In the first part, I cover how to create a world, static and dynamic objects, how to add interaction and work with collision detection.