An open API service indexing awesome lists of open source software.

https://github.com/mrbenhowl/flattenxml

Flattens formatted XML
https://github.com/mrbenhowl/flattenxml

flatten flattener javascript nodejs npm xml

Last synced: 3 months ago
JSON representation

Flattens formatted XML

Awesome Lists containing this project

README

        

# FlattenXML
Small JavaScript/NodeJS library that takes a formatted XML string like the following:

```xml




hedgehogs are awesome

```

and makes it as flat as a pancake like so:

```xml
hedgehogs are awesome
```

## Installation
Using npm / yarn:
```shell
npm i flattenxml

yarn add flattenxml
```

## Usage
```js
const flattenXml = require('flattenxml')

const formattedXml = `




hedgehogs are awesome

`

console.log(flattenXml(formattedXml))
```

## Credits
Made possible because of the fantastic [xmldoc](https://github.com/nfarina/xmldoc)