Socket
Book a DemoInstallSign in
Socket

rim-parse-document

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rim-parse-document

Parse documents from RIM service

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
4
Created
Source

Build Status js-standard-style

rim-parse-document

Greenkeeper badge 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))
  }
})

License

MIT

Keywords

isi

FAQs

Package last updated on 18 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts