Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rafaeljesus/koa-xml

XML request body parser for Koa
https://github.com/rafaeljesus/koa-xml

koa node xml

Last synced: 4 months ago
JSON representation

XML request body parser for Koa

Awesome Lists containing this project

README

        

## koa-xml
[![Node version](https://img.shields.io/node/v/latest-version.svg?style=flat-square)](https://npmjs.org/package/koa-xml)
[![NPM version](http://img.shields.io/npm/v/koa-xml.svg?style=flat-square)](https://www.npmjs.org/package/koa-xml)
[![Build Status](https://img.shields.io/travis/rafaeljesus/koa-xml/master.svg?style=flat-square)](https://travis-ci.org/rafaeljesus/koa-xml)
[![bitHound Score](https://www.bithound.io/github/rafaeljesus/koa-xml/badges/score.svg)](https://www.bithound.io/github/rafaeljesus/koa-xml)
[![bitHound Dependencies](https://www.bithound.io/github/rafaeljesus/koa-xml/badges/dependencies.svg)](https://www.bithound.io/github/rafaeljesus/koa-xml/master/dependencies/npm)
[![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/rafaeljesus/koa-xml/blob/master/LICENSE)

XML request body parser for koa

## Usage

```bash
npm install --save koa-xml
```

```js
const koa = require('koa')
const xml = require('koa-xml')

const options = {
normalize: true,
firstCharLowerCase: true,
explicitArray: false,
ignoreAttrs: true
}

app.use(xml(options))
```

## Xml parse options
Uses [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) see all available [options] (https://github.com/Leonidas-from-XIV/node-xml2js#options)

Supported methods: `POST`, `PUT`, `PATCH`, and `TRACE`.

Supported `Content-Type`: `application/xml`

## Contributing
- Fork it
- Create your feature branch (`git checkout -b my-new-feature`)
- Commit your changes (`git commit -am 'Add some feature'`)
- Push to the branch (`git push origin my-new-feature`)
- Create new Pull Request

## Maintaners

* [Rafael Jesus](https://github.com/rafaeljesus)

## License
koa-xml is released under the [MIT License](http://www.opensource.org/licenses/MIT).