# explanation

> A fancy logging tool

Latest version **0.1.2** (published 2019-01-17) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2019-01-17 |
| First published | 2016-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.3.0 |
| Dependencies | 3 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jason Lenoble |
| Maintainers | jlenoble |

## Links

- npm: https://www.npmjs.com/package/explanation
- Repository: https://github.com/jlenoble/explanation
- Homepage: https://github.com/jlenoble/explanation#readme
- Issues: https://github.com/jlenoble/explanation/issues
- npm.io page: https://npm.io/package/explanation

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [moment](https://npm.io/package/moment.md) ^2.17.0
- [is-string](https://npm.io/package/is-string.md) ^1.0.4

## Recent versions

- 0.1.2 (latest) — 2019-01-17
- 0.1.1 — 2017-01-09
- 0.1.0 — 2016-11-25

## README

# explanation
A fancy logging tool

## Usage

```js
import {info, warn, error} from 'explanation';

info({
  message: "Doing this",
  explain: "We want that"
});

warn({ // explain can be an arbitary array of messages
  message: "Something has occurred",
  explain: [ "You should have done this",
  "and you should have done this",
  "and this" ]
});

error({ // An instance explanation can be a 2-array
  message: "An error has occurred",
  explain: [ "You have called : ",
  data ] // Problem with this data
});

error({ // Explanations types can be mixed
  message: "An error has occurred",
  explain: [ ["You have called : ",
  data],
  "Dummy you!",
  ["And you have also called",
  data2],
  "That's even worse :(!" ]
});
```

Here is the output when the above examples were tested:

![alt text](https://cloud.githubusercontent.com/assets/20752619/20630961/7a979678-b334-11e6-966b-729f4edb806e.png)

```info``` and ```warn``` don't throw errors unless you pass an Error Type as argument. ```error``` always throws an error, either the one passed as argument or a new one generated from the message passed.

## License

explanation is [MIT licensed](./LICENSE).

© 2016 [Jason Lenoble](mailto:jason.lenoble@gmail.com)

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