xmlcreate is a Node.js module that can be used to build XML using a simple API.
xmlcreate allows you to use a series of chained function calls to build an XML tree.
Once the tree is built, it can be serialized to text. The formatting of the text is customizable.
xmlcreate can perform some basic validation to check that the resulting XML is well-formed.
The easiest way to install xmlcreate is using npm:
npm install xmlcreate
You can also build xmlcreate from source using npm:
git clone https://github.com/michaelkourlas/node-xmlcreate.git npm install npm run-script build
build script will build the production variant of xmlcreate, run all
tests, and build the documentation.
You can build the production variant without running tests using the script
prod. You can also build the development version using the script
The only difference between the two is that the development version includes
The documentation for the current version is available here.
You can also build the documentation using npm:
npm run-script docs
The following TypeScript example illustrates the basic usage of xmlcreate:
This example produces the following XML:
My page titleWelcome!This is some text on my website.
xmlcreate includes a set of tests to verify core functionality. You can run the tests using npm:
npm run-script test-prod
The only difference between the
test-dev scripts is that the
development version includes source maps.
xmlcreate is licensed under the Apache License 2.0. Please see the LICENSE.md file for more information.