Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rafaeljesus/koa-xml
- Owner: rafaeljesus
- Created: 2015-10-02T00:51:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T11:03:51.000Z (over 8 years ago)
- Last Synced: 2024-09-27T21:41:03.663Z (4 months 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
[![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).