You can send in your Node projects for review through our contact form.
Benjamin Lupton sent in Caterpillar (GitHub: bevry / caterpillar, License: MIT, npm: caterpillar), which is a logging system. It supports RFC-standard log levels, but the main reason I thought it was interesting is it's based around the streams2 API.
By piping a Caterpillar stream through a suitable instance of stream.Transform, you can do all kinds of cool things. For example, caterpillar-filter can filter out unwanted log levels, and caterpillar-human adds fancy colours.
I was impressed by Brian Carlson's sql module, and Ramesh Nair sent in squel (GitHub: hiddentao / squel, License: BSD, npm: squel) which is a similar project. This SQL builder module supports non-standard queries, and has good test coverage with Mocha.
Ramesh has included some client-side examples as well, which sounds dangerous but may find uses, perhaps by generating SQL fragments to be used by an API that safely escapes them, or for generating documentation examples.
mongoose-currency (GitHub: catalystmediastudios / mongoose-currency, License: MIT, npm: mongoose-currency) by Paul Smith adds currency support to Mongoose. Money values are stored as an integer that represents the lowest unit of currency (pence, cents). Input can be a string that contains a currency symbol, commas, and a decimal.
The Currency type works by stripping non-numerical characters. I'm not sure if this will work for regions where numbers use periods or spaces to separate groups of digits -- it seems like this module would require localisation support to safely support anything other than dollars.
Paul has included unit tests written with Mocha, so it could be extended to support localised representations of currencies.
Node.js Knockout is currently being judged, the winners will be announced on the 20th of November. The site is actually a small game in itself -- click around to move your character and type to say something.
Objects created with BigNumber behave like the built-in Number type in that they have toExponential, toFixed, toPrecision, and toString methods.
Mike found the only other serious arbitrary-precision library for decimal arithmetic on npm is bigdecimal, which originates from the Google GWT project. Mike has written some examples of bigdecimal's problems to illustrate bugs he found while working with it, and offers bignumber.js as an alternative.
r...e (License: MIT, npm: r...e) by Veselin Todorov is a module for manipulating range expressions. Ranges are specified as separate arguments or strings, and a suitable array will be returned:
Stepped ranges are supported (0, 10, 5) as well as convenience methods like range(1, 3).include(2), map, join, sum, and so on. It works in browsers, and includes Mocha tests.
Mongoose-Filter-Denormalize (License: MIT) by Samuel Reed is a filtering and denormalization for Mongoose -- it essentially provides a way of preventing Mongoose from accidentally exposing sensitive data:
'owner' : ['name', 'address', 'fb.id', 'fb.name', 'readOnlyField'],
'public': ['name', 'fb.name']
'owner' : ['name', 'address', 'fb.id', 'writeOnlyField']
// 'nofilter' is a built-in filter that does no processing, be careful with this
sanitize: true // Escape HTML in strings
Now when passing the result of a findOne or other query to, say, res.send in your Express app, fields can be restricted based on user: