# prettify-xml

> Pretty-print XML.

Latest version **1.2.0** (published 2017-06-20) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.2.0 |
| Published | 2017-06-20 |
| First published | 2016-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jonathan Werner |
| Maintainers | jonathanewerner |

## Links

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

## Recent versions

- 1.2.0 (latest) — 2017-06-20
- 1.1.0 — 2017-06-19
- 1.0.1 — 2016-11-29
- 1.0.0 — 2016-04-03

## README

# prettify-xml
[![Build Status](https://img.shields.io/travis/jonathanewerner/prettify-xml.svg?style=flat-square)](https://travis-ci.org/jonathanewerner/prettify-xml)
[![Code Coverage](https://img.shields.io/codecov/c/github/jonathanewerner/prettify-xml.svg?style=flat-square)](https://codecov.io/github/jonathanewerner/prettify-xml)
[![version](https://img.shields.io/npm/v/prettify-xml.svg?style=flat-square)](http://npm.im/prettify-xml)
[![downloads](https://img.shields.io/npm/dm/prettify-xml.svg?style=flat-square)](http://npm-stat.com/charts.html?package=prettify-xml&from=2015-08-01)
[![MIT License](https://img.shields.io/npm/l/prettify-xml.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)

 > Pretty print xml.

This is a small package that synchronously pretty prints XML/HTML.

## Usage
```js
const prettifyXml = require('prettify-xml')

const input = '<div><p>foo</p><p>bar</p></div>'

const expectedOutput = [
  '<div>',
  '  <p>foo</p>',
  '  <p>bar</p>',
  '</div>',
].join('\n')

const options = {indent: 2, newline: '\n'} // 2 spaces is default, newline defaults to require('os').EOL
const output = prettifyXml(input, options) // options is optional

assert(output === expectedOutput)
```

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