# pretty-data

> plugin to pretty-print or minify XML, JSON, CSS and SQL files

Latest version **0.40.0** (published 2012-06-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.40.0 |
| Published | 2012-06-17 |
| First published | 2012-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/pretty-data) |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 157 |
| Author | Vadim Kiryukhin |
| Maintainers | vkiryukhin |
| Keywords | pretty print, beautify, minify, XML, JSON, CSS, SQL |

## Links

- npm: https://www.npmjs.com/package/pretty-data
- Repository: http://github.com/vkiryukhin/pretty-data
- npm.io page: https://npm.io/package/pretty-data

## 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

- 0.40.0 (latest) — 2012-06-17
- 0.30.3 — 2012-03-19
- 0.30.1 — 2012-03-08
- 0.30.0 — 2012-03-06
- 0.20.2 — 2012-02-21
- 0.20.1 — 2012-02-21
- 0.20.0-beta — 2012-02-21

## README

# pretty-data - Nodejs plugin

nodejs plugin to **pretty-print** or **minify**
text in **XML**, **JSON**, **CSS**  and  **SQL** formats.

**Version** - 0.40.0

**Copyright** (c) 2012 Vadim Kiryukhin ( vkiryukhin @ gmail.com )

**Home page:** [http://www.eslinstructor.net/pretty-data/](http://www.eslinstructor.net/pretty-data/) 

**License:** Dual licensed under
the MIT and GPL licenses:

[http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)

[http://www.gnu.org/licenses/gpl.html](http://www.gnu.org/licenses/gpl.html)

##Description

* `pd.xml(data )` - pretty print XML; 

* `pd.json(data)` - pretty print JSON; 

* `pd.css(data )` - pretty print CSS; 

* `pd.sql(data )` - pretty print SQL; 

* `pd.xmlmin(data [, preserveComments]) ` - minify XML; 

* `pd.jsonmin(data)` - minify JSON text;

* `pd.cssmin(data [, preserveComments] )` - minify CSS text; 

* `pd.sqlmin(data)` - minify JSON text;

**PARAMETERS:**

`@data` - String; XML, JSON, CSS or SQL text to beautify; 

`@preserveComments` - Bool (optional, used in npp.minxml and npp.mincss only); 
                       Set this flag to true to prevent removing comments from @data; 

`@Return` - String;


**USAGE:**

`var pd = require('pretty-data').pd; `

`var xml_pp = pd.xml(data); `

`var xml_min = pd.xmlmin(data [,true]);` 

`var json_pp = pd.json(data);` 

`var json_min = pd.jsonmin(data);` 

`var css_pp = pd.css(data); `

`var css_min = pd.cssmin(data [, true]);`

`var sql_pp = pd.sql(data);` 

`var sql_min = pd.sqlmin(data);` 

**TEST:**

`node ./test/test_xml 

`node ./test/test_json

`node ./test/test_css

`node ./test/test_sql

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