# thenlog

> js promise .then() calls logger for node and browser

Latest version **0.1.3** (published 2017-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install thenlog
pnpm add thenlog
yarn add thenlog
bun add thenlog
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2017-02-09 |
| First published | 2017-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | invntrm |
| Maintainers | invntrm |
| Keywords | promise, logger |

## Links

- npm: https://www.npmjs.com/package/thenlog
- Repository: https://github.com/a-x-/thenlog
- Homepage: https://github.com/a-x-/thenlog#readme
- Issues: https://github.com/a-x-/thenlog/issues
- npm.io page: https://npm.io/package/thenlog

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2017-02-09
- 0.1.2 — 2017-02-09
- 0.1.1 — 2017-02-09

## README

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

```js
require('thenlog');

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

Browser / Node.js

<img width="300" src="https://cloud.githubusercontent.com/assets/6201068/22793566/4675183a-ef01-11e6-88c5-c5230f64482d.png"/> <img width="500" align="right" src="https://cloud.githubusercontent.com/assets/6201068/22793390/c4d30cf6-ef00-11e6-881d-13bc216b0f09.png"/> 


## 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`, что очень неудобно, см. выше.

---
_Source: https://npm.io/package/thenlog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
