How to use the fast-xml-parser.convertToJson function in fast-xml-parser

To help you get started, we’ve selected a few fast-xml-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github muzishuiji / node-wechat / util / tpl.js View on Github external
function xmlToJson(result) {
	var options = {
		attrPrefix : "@_",
		textNodeName : "#text",
		ignoreNonTextNodeAttr : true,
		ignoreTextNodeAttr : true,
		ignoreNameSpace : true,
		ignoreRootElement : false,
		textNodeConversion : true,
		textAttrConversion : false,
		arrayMode : false
	}
	var tObj = fastXmlParser.getTraversalObj(result,options)
	var jsonObj = fastXmlParser.convertToJson(tObj)
	return jsonObj
}
exports = module.exports = {

fast-xml-parser

Validate XML, Parse XML, Build XML without C/C++ based libraries

MIT
Latest version published 3 months ago

Package Health Score

91 / 100
Full package analysis