# pretty-print

> Print formatted data to the the command line

Latest version **2.0.0** (published 2018-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install pretty-print
pnpm add pretty-print
yarn add pretty-print
bun add pretty-print
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-07-31 |
| First published | 2013-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Scott Corgan |
| Maintainers | scottcorgan |
| Keywords | pretty, print, cli, command, line, terminal |

## Links

- npm: https://www.npmjs.com/package/pretty-print
- Repository: https://github.com/scottcorgan/pretty-print
- Homepage: https://github.com/scottcorgan/pretty-print#readme
- Issues: https://github.com/scottcorgan/pretty-print/issues
- npm.io page: https://npm.io/package/pretty-print

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ~2.4.1
- [lodash](https://npm.io/package/lodash.md) ~4.17.10
- [as-array](https://npm.io/package/as-array.md) ^2.0.0
- [feedback](https://npm.io/package/feedback.md) ~0.3.x

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-07-31
- 1.1.0 — 2015-10-04
- 1.0.0 — 2014-09-26
- 0.4.1 — 2014-04-21
- 0.4.0 — 2014-03-28
- 0.3.1 — 2014-03-28
- 0.3.0 — 2014-02-07
- 0.2.3 — 2013-12-03
- 0.2.2 — 2013-11-05
- 0.2.1 — 2013-11-05
- 0.2.0 — 2013-11-05
- 0.1.3 — 2013-10-30
- 0.1.2 — 2013-10-29
- 0.1.1 — 2013-10-29
- 0.1.0 — 2013-10-29
- … 1 more at https://npm.io/package/pretty-print/versions

## README

pretty-print
============

Print formatted data to the the command line.

## Install

```
npm install pretty-print --save
```

## Usage

###Object

**Options**

* ` leftPadding ` - extra padding before the object key. Defaults to 2.
* ` rightPadding ` - extra padding after the object key. Defaults to 2.

```javascript
var print = require('pretty-print');
var options = {
  leftPadding: 2,
  rightPadding: 3
};

print({
  key: 'value'
  longerKey: 'value'
}, options);

// outputs
//
//   key        value
//   longerKey  value
```

### Array of objects

**Options**

* ` leftPadding ` - extra padding before the object key. Defaults to 2.
* ` rightPadding ` - extra padding after the object key. Defaults to 2.
* ` key ` - name of the value to use as the list key
* ` value ` - name of value to use as the list value

```javascript
var print = require('pretty-print');
var options = {
  rightPadding: 3,
  key: 'name',
  value: 'height'
};

print([
  {
    name: 'guy',
    height: 'short',
  },
  {
    name: 'girl',
    height: 'short'
  }
], options);

// outputs:
//
// guy:   short
// girl:  short
```

### Array of strings or numbers

```javascript
var print = require('pretty-print');

print(['val1', 'val2', 'val3'], {leftPadding: 0});

// outputs:
//
//  val1
//  val2
//  val3
```

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