loggerage-promisify
Only work with loggerage verson >=2.0
loggerage-promisify is a helper for promisify methods of loggerage package
How to use
$ npm install --save loggerage-promisify
or
$ yarn add loggerage-promisify
const Loggerage = ;const promisify = const logger = ; logger // is a promise now! ;
Or, if you want promisify only the actual async method, you can specify:
const Loggerage = ;const promisify = const logger = ; logger; // is sync and NOT is a promise logger // is async and promise! ;
Understanding
When you don't specify the onlyAsync
property totrue
, the methods with 'Async' suffix are promisificated as you expect, like debugAsync
, infoAsync
, and synchronous methods like info
,debug
, getLog
, etc. are matched to the previous asynchronous methods. For this reason it will be the same to call debug
as todebugAsync
, etc.
When you (yes) specify the onlyAsync
property totrue
, only the methods with 'Async' suffix are promisificated, like debugAsync
, infoAsync
, etc.
Run test
$ npm install && npm test
or
$ yarn install && yarn run test