mag
mag copied to clipboard
Simpler design
The design of mag is modular, but it is certainly overkill for most of simple cases. I would suggest not the streams but "middleware" concept. This is the way express.js works, Faraday or Faye from Ruby world.
How I like logger to be:
var log = require('mag').logger(domain);
log.use( mag.colorFormatter )
log.use( function(item, cb) {...} );
log.error('Oppa Ghannam Style');
The concept of middleware is it is some function that is called by module when it needs something. express.js is extremely simple - all I need is a single function for most of cases
I think this feature is suitable for mag-hub
module.
Additional it is possible to implement both way: pipes and middlewares.