# pretty

> Some tweaks for beautifying HTML with js-beautify according to my preferences.

Latest version **2.0.0** (published 2017-04-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-04-13 |
| First published | 2013-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/pretty) |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 138 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | beautify, format, formatter, html, js, js-beautify, prettify, pretty |

## Links

- npm: https://www.npmjs.com/package/pretty
- Repository: https://github.com/jonschlinkert/pretty
- Issues: https://github.com/jonschlinkert/pretty/issues
- npm.io page: https://npm.io/package/pretty

## Dependencies (3)

- [js-beautify](https://npm.io/package/js-beautify.md) ^1.6.12
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^2.0.1
- [condense-newlines](https://npm.io/package/condense-newlines.md) ^0.2.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-04-13
- 1.0.0 — 2015-01-04
- 0.1.2 — 2013-12-29
- 0.1.1 — 2013-10-24
- 0.1.0 — 2013-10-24

## README

# pretty [![NPM version](https://img.shields.io/npm/v/pretty.svg?style=flat)](https://www.npmjs.com/package/pretty) [![NPM monthly downloads](https://img.shields.io/npm/dm/pretty.svg?style=flat)](https://npmjs.org/package/pretty) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/pretty.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/pretty)

> Some tweaks for beautifying HTML with js-beautify according to my preferences.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save pretty
```

Install with [yarn](https://yarnpkg.com):

```sh
$ yarn add pretty
```

## Usage

```js
var pretty = require('pretty');

pretty(STRING_OF_HTML);
```

Before

```html
<!DOCTYPE html> <html lang="en"> <head> 
<meta charset="UTF-8"> <title>Home</title> 
</head> <body> This is content. </body> </html>
```

After

```html
<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Home</title>
  </head>
  <body>
    This is content.
  </body>
</html>
```

## Options

### ocd

```js
pretty(STRING_OF_HTML, {ocd: true});
```

**Type**: `Boolean`

**Default**: `undefined`

* condenses multiple newlines to a single newline
* trims leading and trailing whitespace
* ensures that a trailing newline is inserted
* normalizes whitespace before code comments

## About

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 13, 2017._

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