Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 4, 2024 via pnpm
Package summary
Share
0
issues
2
licenses
1
ISC
1
MIT
Package created
25 May 2016
Version published
13 Feb 2019
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
sax@1.3.0

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
xml-js@1.6.11
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of xml-js 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
sax1.3.014.99 kBISC
prod

Visualizations

Frequently Asked Questions

What does xml-js do?

The npm package "xml-js" serves as a converter between XML text and JavaScript objects or JSON text. It allows users to transform XML text into JavaScript objects or JSON text and vice versa while maintaining the order of elements. The functionality spans to include handling of elements, attributes, texts, comments, CData, DOCTYPE, XML declarations, and Processing Instructions, while also extending support to command-line operations.

How do you use xml-js?

To use the xml-js package, you first need to install it via npm using the command npm install --save xml-js. Once installed, it can be imported into your JavaScript file with var convert = require('xml-js');.

You can then convert XML to JSON with:

var xml = '<root>Hello xml-js</root>';
var result = convert.xml2json(xml, {compact: true, spaces: 4});
console.log(result); 

And JSON to XML with:

var json = { "_declaration": { "_attributes": { "version": "1.0", "encoding": "utf-8" } }, "root": { "_text": "Hello xml-js" } };
var result = convert.json2xml(json, {compact: true, spaces: 4});
console.log(result); 

Please note that in the example above, the xml2json() and json2xml() functions are used with compact mode enabled, where the XML is represented compactly as {"a":{}} as opposed to non-compact output {"elements":[{"type":"element","name":"a"}]}.

Where are the xml-js docs?

The xml-js documentation with detailed API reference and usage examples can be found on the xml-js GitHub page here. It covers installation, quick start code, sample conversions, API reference, command-line usage, and more in extensive detail.