RunKit + npm: xml2js

var parseString = require('xml2js').parseString; var xml = `<?xml version="1.0" encoding="utf-8"?> <anime> <entry> <id>2889</id> <title>Bleach - The DiamondDust Rebellion</title> <english>Bleach: Diamond Dust Rebellion</english> <synonyms>Bleach: The Diamond Dust Rebellion - M&Aring; Bleach - The DiamondDust Rebellion - Mou Hitotsu no Hyourinmaru</synonyms> <episodes>1</episodes> <type>Movie</type> <status>Finished Airing</status> <start_date>2007-12-22</start_date> <end_date>2007-12-22</end_date> <synopsis>A valuable artifact known as &amp;quot;King's Seal&amp;quot; is stolen... Meanwhile, a rogue Hitsugaya searches... (from ANN)</synopsis> <image>https://myanimelist.cdn-dena.com/images/anime/6/4052.jpg</image> </entry> </anime>`; parseString(xml, function (err, result) { console.log(JSON.parse(JSON.stringify(result))); });
Created from: https://runkit.com/npm/xml2js
Loading…

no comments

    sign in to comment