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

xml 1.0.1

Fast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples.
Package summary
Share
0
issues
1
license
1
MIT
Package created
11 Apr 2011
Version published
31 Jan 2016
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

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
1 Packages, Including:
xml@1.0.1
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

0
All Dependencies CSV
β“˜ This is a list of xml 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does xml do?

The npm package "xml" is a fast and simple JavaScript-based XML generator or builder for Node projects. This tool supports attributes, CDATA, and more, making it a comprehensive solution for generating XML strings in your Node.js applications.

How do you use xml?

To use the "xml" package, you first need to install it using npm by running the command npm install xml in your terminal.

The primary API function of this module is xml(xmlObject, options), which takes an object representation of your XML data (the xmlObject) and an optional options object, then returns an XML string.

Here's a basic usage example:

var xml = require('xml');
var xmlString = xml({a: 1});

In the above example, the xml function will turn {a: 1} into <a>1</a>, with keys becoming tag names and values becoming the tag content.

To set attributes or include CDATA sections in your XML, you can use special keys _attr and _cdata. Here's an example:

var xmlString = xml({a: { _attr: { attr:'hi'}, _cdata: "I'm not escaped" }});

The above will result in: <a attr="hi"><![CDATA[I'm not escaped]]></a>

You can also generate and process large XML documents in a streaming fashion, add XML declaration, and use indent options for easy reading.

Where are the xml docs?

The documentation for the "xml" package can be found in the README file on the package's GitHub page, located at https://github.com/dylang/node-xml.

Details on how to use the API, install the package, run tests, and contribute to the project are all covered in the documentation. Examples of usage can also be found in the examples directory.