https://github.com/rafaeljesus/koa-xml
XML request body parser for Koa
https://github.com/rafaeljesus/koa-xml
koa node xml
Last synced: 8 months ago
JSON representation
XML request body parser for Koa
- Host: GitHub
- URL: https://github.com/rafaeljesus/koa-xml
- Owner: rafaeljesus
- Created: 2015-10-02T00:51:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T11:03:51.000Z (almost 10 years ago)
- Last Synced: 2025-02-01T07:31:41.740Z (over 1 year ago)
- Topics: koa, node, xml
- Language: JavaScript
- Size: 11.7 KB
- Stars: 3
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## koa-xml
[](https://npmjs.org/package/koa-xml)
[](https://www.npmjs.org/package/koa-xml)
[](https://travis-ci.org/rafaeljesus/koa-xml)
[](https://www.bithound.io/github/rafaeljesus/koa-xml)
[](https://www.bithound.io/github/rafaeljesus/koa-xml/master/dependencies/npm)
[](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).