Grunt - Read XML File

gruntjs

Solution

If you want something that doesn't require python or a c compiler, and is synchronous, try node-xml-lite:

var parseXML = require('node-xml-lite').parseString;
var webConfigDoc = parseXML(grunt.file.read('../web.config'));

The parsed document object can be a little tricky to work with, but underscore find* methods can help.

Problem

I am new to grunt. I'm trying to figure out how to read an `.xml` file from a grunt task. Ideally, I'd like to load the xml into JSON. However, I can't figure out how to even read an `.xml` file from a grunt task. Does anyone have an example of how to do this? Thank you!

Original source