gulp-xml2json
gulp plugin convert xml to json
Install
Install with npm
npm install --save-dev gulp-xml2json
Example
var gulp = ;var xml2json = ;var rename = ; gulp;
API
xml2json(options)
options
(optional) parameter, which is used to create node-xml2js Parser.
See node-xml2js Options documentation.
By setting these options you can modify the Json files created after transformation.
Example with options
var gulp = ;var xml2json = ;var rename = ;/*var jsonFormat = require('gulp-json-format');var lineEnding = require('gulp-line-ending-corrector');*/ gulp;
Example is extracted from usage of gulp-xml2json plugin for https://github.com/Asseco-CE/eHealth-hackathon event 2016. Plugin was used to prepare Json data from old Xml (source) data. In this example, additional useful gulp plugins were commented-out, but you may consider to use them along with gulp-xml2json.
License
MIT @chilijung