🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

isomorphic-xml2js

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-xml2js

XML parsing for browser and node.js

0.0.2
Source
npm
Version published
Weekly downloads
2.7K
26.09%
Maintainers
1
Weekly downloads
 
Created
Source

isomorphic-xml2js

A drop-in replacement for xml2js that uses the built in DOMParser/XMLSerializer when bundled for the browser, drastically reducing the bundle size. Simply exports xml2js when used in a node.js environment.

Currently no options are supported except for rootName on Builder. The goal is to eventually create a browser-friendly implementation of all the xml2js API (within reason). For now it just works the way I happen to have configured xml2js in the past, which is basically like so:

const parserOpts = {
  explicitArray: false,
  explicitCharkey: false,
  explicitRoot: false
};

const builderOpts = {
  explicitArray: false,
  explicitCharkey: false
  rootName: "some-root-name"
};

Detailed bundle size and performance comparisons in the browser will come later. For now it appears that you can reduce your minified bundle size by about 120kb by using isomorphic-xml2js over xml2js in your project.

Keywords

xml

FAQs

Package last updated on 02 May 2018

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