Node Roundup: Magnolia, VMUX, joinr

24 Jul 2013 | By Alex Young | Tags node modules mongodb video webrtc
You can send in your Node projects for review through our contact form.

Magnolia

Ryan Munro sent in some of his projects, including Magnolia (GitHub: Submersible / node-magnolia, License: MIT, npm: magnolia) and Figs (GitHub: Submersible / node-figs, License: MIT). Magnolia is a MongoDB client library that has a chainable API and support for promises, which means you can compose expressions using a natural JavaScript-friendly syntax.

magnolia('user')
  .filter({_id: ObjectID('4e4e1638c85e808431000003')})
  .one()
  .then(function(user) {
      console.log('hello', user.name);
  });

Figs is a module for working with settings stored in JSON files. It supports local overrides, “parent directory clobbering”, and overriding when environmental variables are set. It also includes a command-line tool for viewing configurations.

VMUX

VMUX

VMUX (GitHub: malditogeek / vmux, License: BSD) by Mauro Pompilio is an open source video call application that works in browsers, and uses Node. Nodejitsu wrote about it as part of their open source project of the month programme. The readme includes details on how to set it up locally, but you can also try out the service running on Nodejitsu by signing in with Twitter.

Nodejitsu’s blog has had a flurry of activity recently, including a cool post about GUI console applications.

joinr

There is another MongoDB module this week that I wanted to write about: joinr (GitHub: punkave / joinr, License: MIT, npm: joinr) by Tom Boutell. This one fetches related documents by performing join-related operations:

joinr allows joins to be performed via IDs stored in a regular property (byOne) or in an array property (byArray). Joins can be performed when the ID of the related document is in the document you already have (byOne or byArray) and also when the related documents contain the IDs of documents you already have (byOneReverse and byArrayReverse).

For example, a one-to-many join through an array property looks like this:

joinr.byArray(users, 'groupIds', '_groups', function(ids, callback) {
  return groupsCollection.find({ groupIds: { $in: ids } }, callback);
}, callback);

There are more examples in the readme.


blog comments powered by Disqus