express-xml-parser

1.0.0 • Public • Published

express-xml-parser

NPM version Build Status

  • use type-is to check whether a xml request
  • use raw-body to get decoded text body from request
  • and xml2js to parse to json

Usage

===

var options = {
  // options will apply to is-type
  type: ['xml'],    //default [ 'xml' ]
 
  // options will apply to raw-body
  limit: '1mb',     //default 100kb,
  encoding: 'utf8'  //default utf8,
 
  // options will apply to xml2js
  trim: false
};
app.use(xmlBodyParser(options));
app.post('/xml', function(req, res) {
  // req.body is a xml-json
});

Package Sidebar

Install

npm i express-xml-parser

Weekly Downloads

109

Version

1.0.0

License

MIT

Last publish

Collaborators

  • idy