rim-parse-document
v1.0.3
Published
Parse documents from RIM service
Downloads
10
Readme
rim-parse-document
parse xml from rim service and return json
Usage
Input xml and get json in return
Promises
'use strict'
const fs = require('fs')
const rimParseDocument = require('rim-parse-document')
const document = fs.readFileSync('test/data/data.xml', 'utf-8')
rimParseDocument(document)
.then((data) => {
console.log(JSON.stringify(data, null, 2))
})
.catch((error) => {
console.error(error)
})
Callback
'use strict'
const fs = require('fs')
const rimParseDocument = require('rim-parse-document')
const document = fs.readFileSync('test/data/data.xml', 'utf-8')
rimParseDocument(document, (error, data) => {
if (error) {
console.error(error)
} else {
console.log(JSON.stringify(data, null, 2))
}
})