Countly (GitHub: Countly / countly-server, License: Countly Community Edition License) from the Countly team based in Turkey is a mobile analytics server that has SDKs for iOS and Android. The web interface and API are separated into two applications -- the front-end is built with Express, and the API is a lightweight server. MongoDB is used to store data and sessions. The Express application is a fairly straightforward monolithic implementation.
In terms of client-side code, the Express app uses ejs for templates, and jQuery UI.
The authors have included an installation script, bin/countly.install.sh, which helps get the server-side component up and running. If you want to try it out without installing it, there's a demo on count.ly.
var takeFour = take(4);
takeFour('hello there'); //=> 'hell'
The API feels quite lightweight in places because certain functions accept objects where a function might be used in similar libraries:
The author has included tests written with LiveScript.
fibonacci-async (License: MIT, npm: fibonacci-async) by Enno Boland is a response to certain well-known blog posts berating Node's performance at potentially unfair benchmarks. It's an asynchronous C++ Fibonacci series generator, which strikes me as something potentially useful as an educational example for those interested in writing Node addons.
The author has also included Express middleware, client-side support, and there are some simple unit tests as well.
HighKick (npm: highkick) by Azer Koculu is a lightweight test runner. It'll take a module and execute any method that starts with test, which is more similar to the CommonJS Unit Testing specification than most of the popular Node test frameworks.
Functions can be run before and after each test, or the entire module. There's also an asynchronous mode for running tests asynchronously.
Azer has been using it to test his own modules, so you can check out some of his examples on GitHub.
Spellcheck (License: MIT, npm: spellcheck) by Brian White is an asynchronous Hunspell addon. This is the same library that OpenOffice uses, as well as Chrome.
In this article we're going to look at addons. If you're a Node developer working in Windows then this article should give you enough background to at least understand the basic issues surrounding addons, and install them using npm.
Addons are something Unix-based Node developers generally have little trouble with. However, the history of addon support in Windows has been a little bit turbulent. We've seen various solutions come and go -- most notably node-waf and Cygwin -- but the community has now settled on node-gyp by Nathan Rajlich.
Node-waf doesn't work on Windows.
We're working on a solution that will make it easier to get a build toolchain in Windows based on node-gyp. Many packages will have to be updated to use this instead, so we're trying to make it as easy a transition as possible.
Installing a Module with Native Code
The fibers module uses node-gyp for building its native components. However, the module's author, Marcel Laverdet, has packaged it in an extremely effective way. Rather than force everybody to build the module, he's included binaries in the npm package. These are not present in the GitHub repository, but are available through npm. This includes both 32 and 64 bit versions.
Therefore, simply running npm install fibers should result in a working module in Windows. The compressed archive on npm actually includes Linux, Mac OS, and Windows binaries, for example: bin/win32-ia32/fibers.node.
Building a Module in Windows
As an exercise, let's build the fibers module. I picked this one because I already know it works -- although there are other modules built with node-gyp, they don't all build correctly in Windows yet.
Building the module requires a few dependencies:
A global installation of node-gyp
Microsoft Visual Studio ("Express" is free)
The node-gyp module is easy to install, but just make sure it's installed globally so it'll be in your %PATH%:
npm install -g node-gyp
GYP, or Generate Your Projects, is a build system that uses Python. GypUserDocumentation covers the basics, but from our perspective we just need a working version of Python 2.7.x to use it.
Microsoft provides a free edition of Visual Studio called Visual Studio 2010 Express. I downloaded the ISO and extracted the ISO using 7-Zip. It's 694 MB, so you might want to brew a suitable hot drink while it's downloading.
Fortunately, Microsoft provide this suite of tools and compilers for free with no user registration.
Building the Module
I downloaded the latest zip of node-fibers from GitHub, opened Command Prompt, changed directory to the path of the extracted zip, then ran the following:
Once that was done I ran npm test, and the tests all passed. I found it quite satisfying to see Microsoft's compiler actually build something, and although it's not necessary to build the fibers module this way, there are other modules out there that don't include binaries in npm.
Hopefully you now appreciate a little bit about how addons are built in Windows. Although previously the situation was confusing, the community is starting to convert modules to build with node-gyp.
I suspect there will be cases where native code can't be shipped as binaries due to licensing constraints, but it would be encouraging to see more addons include binaries for Windows.
FireRainbow is an add-on for
Firefox and Firebug that adds themable syntax highlighting. It uses the
to perform the highlighting, and has CSS themes. You can get the themes
on GitHub and paste them into the Colors tab within Firebug.
The performance is good, and it makes Firebug that little bit more
usable and customised.