# preview

> Console logging, inspecting and debugging tool.

Latest version **0.1.3** (published 2017-01-05) · MIT license · 0 weekly downloads

## Install

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

## 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-01-05 |
| First published | 2014-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Mark W. B. Ashcroft |
| Maintainers | fluidecho |
| Keywords | debug, log, logging, inspect, console |

## Links

- npm: https://www.npmjs.com/package/preview
- Repository: https://github.com/fluidecho/preview
- Issues: http://github.com/fluidecho/preview/issues
- npm.io page: https://npm.io/package/preview

## Dependencies (2)

- [colors](https://npm.io/package/colors.md) ~1.1.2
- [minimist](https://npm.io/package/minimist.md) ~1.2.0

## 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-01-05
- 0.1.2 — 2017-01-05
- 0.1.1 — 2014-07-29
- 0.1.0 — 2014-07-29
- 0.0.9 — 2014-07-23
- 0.0.8 — 2014-05-29
- 0.0.7 — 2014-05-27
- 0.0.6 — 2014-05-25
- 0.0.5 — 2014-05-25
- 0.0.4 — 2014-05-25
- 0.0.3 — 2014-05-25
- 0.0.2 — 2014-05-25
- 0.0.1 — 2014-05-25

## README

# Preview

[![build status][travis-image]][travis-url]
[travis-image]: https://api.travis-ci.org/fluidecho/preview.png
[travis-url]: https://travis-ci.org/fluidecho/preview

Console logging, inspecting and debugging tool.  

Instead of having console.log and util.inspect all over your code during development, use preview and can then turn printing on or off using _--preview_ argument.

## Installation

From your terminal, requires [node.js](http://nodejs.org/).

```
npm install preview
```

## Module
```
require('preview')(<namespace>, {options});
preview(<namespace>, <text>, <object>);
```
Objects supported: __{}, [], Number, Buffer, Date, Boolean__

## Example

```js
var preview = require('preview')('app1');

var foo = {bar: 8211, hello: 'world', list: [1,2,3]};   // some object to inspect.

preview('foo');
preview('foo object', foo);
preview('app2', 'foo.bar: ' + foo.bar);
preview('foo foo from app1 again');
```
To run preview, use the _--preview_ argument:
```
node example.js --preview
```
![](http://i.imgur.com/CBuMtOC.png)

### Namespaces

Can print just a specific namespace or a list of namespaces.

```
node example.js --preview=app1
node example.js --preview="app1, app2"
```

## Options
```js
{
  inverse: true   // inverse the background color.
}
```

## License

Choose either: [MIT](http://opensource.org/licenses/MIT) or [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0).

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