UNPKG

node-easy-docx

Version:

NodeJs library to parse docx file content into JSON format.

10 lines (9 loc) 214 B
const xmlJS = require('xml-js') module.exports = { parseXML: function (xml) { if (xml && typeof xml === 'string') { return JSON.parse(xmlJS.xml2json(xml, { compact: true })) } return null } }