# postcss-prettify

> prettify postcss output

Latest version **0.3.4** (published 2016-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-prettify
pnpm add postcss-prettify
yarn add postcss-prettify
bun add postcss-prettify
```

## 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.3.4 |
| Published | 2016-03-17 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jacob Blakely |
| Maintainers | codekirei |
| Keywords | postcss-plugin, prettify |

## Links

- npm: https://www.npmjs.com/package/postcss-prettify
- Repository: https://github.com/codekirei/postcss-prettify
- Homepage: https://github.com/codekirei/postcss-prettify#readme
- Issues: https://github.com/codekirei/postcss-prettify/issues
- npm.io page: https://npm.io/package/postcss-prettify

## Dependencies (2)

- [defined](https://npm.io/package/defined.md) 1.0.0
- [postcss](https://npm.io/package/postcss.md) 5.0.19

## Recent versions

- 0.3.4 (latest) — 2016-03-17
- 0.3.3 — 2016-03-16
- 0.3.2 — 2016-03-16
- 0.3.1 — 2016-03-16
- 0.3.0 — 2016-03-16
- 0.2.0 — 2016-03-12
- 0.1.1 — 2016-03-11
- 0.1.0 — 2016-03-11

## README

# `postcss-prettify` [![version][1]][2] [![build][3]][4] [![coverage][5]][6]

<b>[About](#about)</b> |
<b>[Installation](#installation)</b> |
<b>[Usage](#usage)</b> |
<b>[License](#license)</b>

---

## About

A [PostCSS](https://github.com/postcss/postcss) plugin to prettify output. Requires at least Node.js v0.12. Should likely be included towards the end of a PostCSS plugin chain, if that's your jam.

**Features**
- line breaks between top-level rules and comments
- smart spacing around rules and declarations
- indenting with 2 spaces
- one selector per line

**Example Input**
```css
.foo, .bar {
    background: red;
}
@media only screen and (min-width:600px){.baz{background:blue;}}
```

**Example Output**
```css
.foo,
.bar {
  background: red;
}

@media only screen and (min-width: 600px) {
  .baz {
    background: blue;
  }
}
```

## Installation

**From a terminal**

```sh
npm install --save-dev postcss-prettify
```

## Usage

**As a PostCSS Plugin**
```js
postcss([
  require('postcss-prettify')
])
```

Check the [PostCSS docs](https://github.com/postcss/postcss#usage) for your chosen implementation.

**Standalone**

`postcss-prettify` also exposes a standalone [PostCSS processor instance](https://github.com/postcss/postcss/blob/master/docs/api.md#processorprocesscss-opts) as `prettify.process(css)`:

```js
var fs = require('mz/fs')
var prettify = require('postcss-prettify')

fs.readFile('src/style.css', 'utf8')
  .then(data => prettify.process(data))
  .then(res => fs.writeFile('dist/style.css', res.css))
  .catch(err => console.err(err.stack))
```

## License

[MIT](https://github.com/codekirei/postcss-prettify/blob/master/license)

[1]: https://img.shields.io/npm/v/postcss-prettify.svg?style=flat-square&label=version
[2]: https://www.npmjs.com/package/postcss-prettify
[3]: https://img.shields.io/travis/codekirei/postcss-prettify.svg?style=flat-square&label=tests
[4]: https://travis-ci.org/codekirei/postcss-prettify
[5]: http://img.shields.io/coveralls/codekirei/postcss-prettify.svg?style=flat-square
[6]: https://coveralls.io/github/codekirei/postcss-prettify?branch=master

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