# xml-but-prettier

> Beautifies XML documents by putting each tag and text node on their own line and correctly indents everything

Latest version **1.0.1** (published 2017-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install xml-but-prettier
pnpm add xml-but-prettier
yarn add xml-but-prettier
bun add xml-but-prettier
```

## 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.0.1 |
| Published | 2017-11-02 |
| First published | 2017-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kyle Shockey |
| Maintainers | kyleshockey |

## Links

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

## Dependencies (1)

- [repeat-string](https://npm.io/package/repeat-string.md) ^1.5.2

## Recent versions

- 1.0.1 (latest) — 2017-11-02
- 1.0.0 — 2017-11-02

## README

# XML, But Prettier

[![Build Status][travis-image]][travis-url]
[![NPM version][npm-image]][npm-url]

_This module is a fork of [jonathanp/xml-beautifier][upstream-github]._

This module beautifies XML documents by putting each tag and text node on their own line and correctly indenting everything.

Can be used e.g. if you're using [React as a static page generator][react] and (for some reason) need the generated HTML to be more human-readable.


## Install

```
$ npm install --save xml-beautifier
```


## Usage

The module's function signature is `xmlButPrettier(xml:String, options:Object)`.

```js
import xmlButPrettier from 'xml-but-prettier';

const xml = xmlButPrettier('<div><span>foo</span></div>');
console.log(xml); // => will output correctly indented elements
```

#### Options
- `indentor`: a custom string to use for indenting things
- `textNodesOnSameLine`: compresses text nodes onto the same line as their containing tags

## License

MIT.

[upstream-github]: https://github.com/jonathanp/xml-beautifier
[npm-url]: https://npmjs.org/package/xml-but-prettier
[npm-image]: https://badge.fury.io/js/xml-but-prettier.svg
[travis-image]: https://travis-ci.org/shockey/xml-but-prettier.svg
[travis-url]: https://travis-ci.org/shockey/xml-but-prettier
[react]: https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup

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