Node.js Utilities
Installation
Using npm:
$ npm i --save rhases-nodejs-commons
Using
Pino Log
import l from 'rhases-nodejs-commons';
l.error(err);
l.info("foo", foo);
Service Utils
import {ServiceUtils} from 'rhases-nodejs-commons';
serviceUtils = new ServiceUtils(MyMongooseModel);
all() {
return this.serviceUtils.all();
}
Controller Utils
import {ControllerUtils} from 'rhases-nodejs-commons';
controllerUtils = new ControllerUtils(MyService);
byId(req, res) {
this.controllerUtils.byId(req, res);
}
Control Access