Skip to content

meriamBenSassi/superagent-xml2jsparser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

superagent-xml2jsparser

a parser for visionmedia/superagent that converts XML to json. It uses xml2js

Installation

with npm

npm install superagent-xml2jsparser

Motivation

I needed to access an XML based API with superagent. This seemed the simplest thing to do

Usage

var request = require('superagent');
var xml2jsParser = require('superagent-xml2jsparser');

request
    .get('http://api.openweathermap.org/data/2.5/weather?q=Los Angeles&mode=xml')
    .accept('xml')
    .parse(xml2jsParser) // add the parser function
    .end(function(err, res){
        console.log(res.body)
    })

About

a parser for visionmedia/superagent that converts XML to json

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%