Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler design #5

Open
AlgoTrader opened this issue Aug 13, 2014 · 1 comment
Open

Simpler design #5

AlgoTrader opened this issue Aug 13, 2014 · 1 comment

Comments

@AlgoTrader
Copy link

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

@mahnunchik
Copy link
Owner

I think this feature is suitable for mag-hub module.
Additional it is possible to implement both way: pipes and middlewares.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants