Node Roundup: npm link, mongoq, EventEmitter

2011-04-13 00:00:00 +0100 by Alex R. Young

Isaac Schlueter posted about npm link on the Node
. This is an npm
command for use during development -- link installing a package will
install it using its package.json file, without having to continually
rebuild it as you work on it.

The link command has been refactored in npm 1.0, and Isaac
explains the thinking behind the new implementation.


MongoDB client libraries always seem to be too complicated. Defining
schemas might be nice for application code that requires validation and
other architectural features, but most of the time I just want to
quickly dump or fetch data without thinking about the schema or model
classes. I thought that was kind of what NoSQL document-based databases
were all about?

So the next time I'm feeling lazy I'm going to try
mongoq by zzdhidden. It's a small MongoDB client library based on
node-mongodb-native, and the syntax seems simple enough:

var db = require('mongoq'),
    testdb = db('mongodb://fred:foobar@localhost/testdb');

testdb.collection('people').insert({ name: 'Alex', occupation: 'Wizard' }, function(err, doc) {
  // etc...

Notice that it uses the standard connection string, which means you can
stick database authentication details in there.


EventEmitter (MIT/GPL) by Oliver Caldwell is a version of Node's EventEmitter for
browsers. Oliver has written a fair bit of open source client-side
JavaScript, including the Spark framework.

If you look at
events.js in Node and compare it to
EventEmitter.js you can see that they're similar but Oliver's version has been somewhat