thenlog

0.1.3 • Public • Published

.then log

The js-promise-.then()-calls logger for both node.js and browser.

require('thenlog');
 
Promise.resolve(0)
  .thenlog(v=>+ 1)
  .thenlog(v=>* 2)
  .thenlog(v=>Math.pow(v, 4))
  .then(v => v)
  .thenlog(v=>/ 0)
  .thenlog(v => {})
  .then(v => 'foobar');

Browser / Node.js

Story en

Promise chains debugging is not too convenient. You have to replace code shorthands (e.g. .then(_.union)) by long statements with a console.log instructions.

You have to see many 3th-party call-chains in the browser inspector's debugger in async mode. And debugger injection in node.js for async code debugging using node debug is not convenient way again.

Story ru

Дебажить промисы не очень удобно. То и дело приходится разорять изящные конструкции вида .then(_.union), внедряя туда console.log.

В дебаггере браузера часто приходится смотреть на полотна 3th-party кода. А в node.js с помощью node debug чтобы отлаживать асинхронщину приходится внедрять тут и там debugger, что очень неудобно, см. выше.

Readme

Keywords

Package Sidebar

Install

npm i thenlog

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • invntrm