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 Apr 8, 2024 via pnpm

xml2js 0.4.19

Simple XML to JavaScript object converter.
Package summary
Share
2
issues
2
moderate severity
vulnerability
2
2
licenses
2
MIT
1
ISC
Package created
20 Apr 2011
Version published
22 Aug 2017
Maintainers
1
Total deps
3
Direct deps
2
License
MIT

Issues

2

2 moderate severity issues

moderate
Recommendation: Upgrade to version 0.5.0 or later
via: xml2js@0.4.19
Recommendation: Upgrade to version 0.5.0 or later
via: xml2js@0.4.19
Collapse
Expand

Licenses

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
2 Packages, Including:
xml2js@0.4.19
xmlbuilder@9.0.7

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
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

2
All Dependencies CSV
β“˜ This is a list of xml2js 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
sax1.3.014.99 kBISC
prod
xmlbuilder9.0.718.57 kBMIT
prod

Visualizations

Frequently Asked Questions

What does xml2js do?

xml2js is a simple XML to JavaScript object converter that allows you to parse XML seamlessly. You do not need a compiled C parser, making xml2js an easy, accessible solution for handling XML data. This tool utilizes sax-js and xmlbuilder-js and supports bi-directional conversion. Note that xml2js is not a full DOM parser, so if your project requires this, you might want to consider JSDom.

How do you use xml2js?

You can quickly install xml2js using npm or Bower with the command npm install xml2js or bower install xml2js, respectively. Then, using xml2js is straightforward. Here are some usage examples:

For basic, "shoot-and-forget" usage:

var parseString = require('xml2js').parseString;
var xml = "<root>Hello xml2js!</root>"
parseString(xml, function (err, result) {
    console.dir(result);
});

If you need to use special options:

parseString(xml, {trim: true}, function (err, result) {
});

There's also a simpler usage pattern, requiring no event listeners:

var fs = require('fs'),
    xml2js = require('xml2js');

var parser = new xml2js.Parser();
fs.readFile(__dirname + '/foo.xml', function(err, data) {
    parser.parseString(data, function (err, result) {
        console.dir(result);
        console.log('Done');
    });
});

For more complex usage, parsing multiple files, and additional features, please refer to the documentation.

Where are the xml2js docs?

xml2js detailed documentation with various use cases and code examples can be found in the repository's README file on GitHub: https://github.com/Leonidas-from-XIV/node-xml2js. The README provides extensive information on installation, usage, options, and updates to new versions, among other data. Always refer to the README for the most up-to-date documentation.