DailyJS

Node Roundup: Uptime, mmmagic, nodeflix, opt

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

cli node apps modules express unix

Node Roundup: Uptime, mmmagic, nodeflix, opt

Posted by Alex R. Young on .
Featured

cli node apps modules express unix

Node Roundup: Uptime, mmmagic, nodeflix, opt

Posted by Alex R. Young on .
You can send in your Node projects for review through our contact form or @dailyjs.

Uptime

Uptime screenshot

Uptime (GitHub: fzaninotto / uptime, License: MIT, npm: node-uptime) by Francois Zaninotto is an Express app for remote server monitoring. It's built with Mongoose, Bootstrap, ejs, Socket.IO, and jQuery.

To use the app, a YAML configuration file must be created for the sites you want to monitor. It seems like JSON would have been a more natural choice, but it's pretty easy to get started and there are examples in the documentation.

I'm always looking for open source Express applications, so keep them coming!

mmmagic

mmmagic (License: MIT, npm: mmmagic) by Brian White is a Node addon for libmagic, as used by the file command. It's asynchronous, and can provide the MIME type for a file (as well as other metadata):

var mmm = require('mmmagic')  
  , Magic = mmm.Magic;

var magic = new Magic(mmm.MAGIC_MIME_TYPE);  
magic.detectFile('/usr/bin/env', function(err, result) {  
  if (err) throw err;
  console.log(result);
});

It's currently built with node-waf (rather than gyp), but the author has included a Windows binary.

Nodeflix

Nodeflix (License: MIT, npm: nodeflix) by Johnathan Leppert is a Netflix API client:

n.get('/catalog/people', { term: 'DeNiro' }, function(data) {  
    console.log(data);
});

I've noticed quite a few Node media-related modules cropping up, and with the continually improving Windows support it seems like Node is becoming a strong platform for home theatre-related application development. Is there a Node XBMC alternative yet?

opt

opt (License: New BSD License, npm: opt) by R. S. Doiel is an options parser that can also load configuration files. It can generate usage based on the supplied parameters, but has a slightly different API to the other option parsing modules I've looked at -- callbacks are tied to each option instead of working with a parsed set of options:

#!/usr/bin/env node
var opt = require('opt')  
  , args;

function test(param) {  
  if (param) {
    console.log('--test parameter:', param);
  } else {
    console.log('No parameter supplied to --test');
  }
}

opt.setup('Simple test script.');  
opt.set(['-h', '--help'], opt.usage, 'Show help');  
opt.set(['-t', '--test'], test, 'Run test');

opt.parse(process.argv);  

This is quite different to how Commander.js works, for example.