NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #606 most downloaded on npm
An XML builder for node.js
Last release 6 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 9 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
16 years old
98 releases · first in 2010
Fixed a bug where the noDoubleEncoding flag kept named entities other than those specified in the spec (see #16 in xmlbuilder2).
noDoubleEncoding flag kept named entities other than those specified in the spec (see #16 in xmlbuilder2).Added the invalidCharReplacement option to replace invalid characters with a user supplied replacement character. See #147.
invalidCharReplacement option to replace invalid characters with a user supplied replacement character. See #147.One column per quarter.
Pretty printing now keeps single CDATA nodes in-line with their parent elements. See #224.
Removed support for node.js 6.0\. Minimum required version is now 8.0.
Fixed a bug where importing a document into an empty parent document did not set the root node. See #213.
Corrected typings for doctype and character data nodes. See #211.
Rewrote all TypeSript typings to be strictly compatible with the API. This is a breaking change for TypeScript users only.
Added option for pretty printing attributes.
Removed support for node.js 4.0 and 5.0\. Minimum required version is now 6.0.
Added TypeScript typings. See #200.
Calling end() with arguments no longer overwrites writer options. See #120.
Calling end() with arguments no longer overwrites writer options. See #120.
Added writer state and customizable space and endline functions to help customize writer behavior. Also added openNode and closeNode functions to writer. See #193.
Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See #195.
Renamed elEscape to textEscape in XMLStringifier.
Fixed a bug where empty arrays would produce child nodes. See #190.
Removed the skipNullAttributes option. null attributes are now skipped by default. Added the keepNullAttributes option in case someone needs the old behavior.
Removed the skipNullNodes option. null nodes are now skipped by default. Added the keepNullNodes option in case someone needs the old behavior.
undefined values are now skipped when converting JS objects.
Renamed stringify functions. See #194:
eleName -> nameattName -> nameeleText -> textFixed argument order for attribute function in the writer. See #196.
Added openAttribute and closeAttribute functions to writer. See #196.
Added node types to node objects. Node types and writer states are exported by the module with the nodeType and writerState properties.
Fixed a bug where array items would not be correctly converted. See #159.
Fixed a bug where mixed-content inside JS objects with #text decorator would not be correctly converted. See #171.
Fixed a bug where JS objects would not be expanded in callback mode. See #173.
Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See #169.
Fixed a bug where names would not be validated according to the spec. See #49.
Renamed text property to value in comment and cdata nodes to unify the API.
Removed doctype function to prevent name clash with DOM implementation. Use the dtd function instead.
Removed dummy nodes from the XML tree (Those were created while chain-building the tree).
Renamed attributesproperty to attribs to prevent name clash with DOM property with the same name.
Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See #122.
Fixed an edge case where a null node at root level would be printed although skipNullNodes was set. See #187.
skipNullNodes was set. See #187.Added the skipNullNodes option to skip nodes with null values. See #158.
skipNullNodes option to skip nodes with null values. See #158.Added current indentation level as a parameter to the onData function when in callback mode. See #125.
Simplified regex used for validating encoding.
Nothing published for this version
Nothing published for this version
spacebeforeslash writer option accepts true as well as space char(s).
spacebeforeslash writer option accepts true as well as space char(s).spacebeforeslash writer option can now be used with XML fragments.
spacebeforeslash writer option can now be used with XML fragments.Added the spacebeforeslash writer option to add a space character before closing tags of empty elements. See #157.
spacebeforeslash writer option to add a space character before closing tags of empty elements. See #157.Fixed character validity checks to work with node.js 4.0 and 5.0\. See #161.
Removed case conversion options.
Falsy values can now be used as a text node in callback mode.
Falsy values can now be used as a text node. See #117.
Removed lodash dependency to keep the library small and simple. See #114, #53, and #43.
Added the callback option to the begin export function. When used with a callback function, the XML document will be generated in chunks and each chun
begin export function. When used with a callback function, the XML document will be generated in chunks and each chunk will be passed to the supplied function. In this mode, begin uses a different code path and the builder should use much less memory since the entire XML tree is not kept. There are a few drawbacks though. For example, traversing the document tree or adding attributes to a node after it is written is not possible. It is also not possible to remove nodes or attributes.var result = '';
builder.begin(function(chunk) { result += chunk; })
.dec()
.ele('root')
.ele('xmlbuilder').up()
.end();
Object.assign with lodash.assign to support old JS engines. See #111.Added the begin export function. See the wiki for details.
begin export function. See the wiki for details.commentBefore, commentAfter, instructionBefore and instructionAfter functions for this purpose.Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously process…
Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element.
root.ele('node').ins('pi');
// pre-v7
<?pi?><node/>
// v7
<node><?pi?></node>
Added custom XML writers. The default string conversion functions are now collected under the XMLStringWriter class which can be accessed by the strin
XMLStringWriter class which can be accessed by the stringWriter(options) function exported by the module. An XMLStreamWriter is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the streamWriter(stream, options) function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling end() on the XML document.Moved require statements for text case conversion to the top of files to reduce lazy requires.
Added text case option for element names and attribute names. Valid cases are lower, upper, camel, kebab and snake.
lower, upper, camel, kebab and snake.allowEmpty option to end(). When this option is set, empty elements are not self-closed.]]> in CDATA is now automatically replaced with ]]]]><![CDATA[>.Updated lodash dependency to 4.0.0.
Added the noDoubleEncoding option to create() to control whether existing html entities are encoded.
noDoubleEncoding option to create() to control whether existing html entities are encoded.Added the separateArrayItems option to create() to control how arrays are handled when converting from objects. e.g.
separateArrayItems option to create() to control how arrays are handled when converting from objects. e.g.root.ele({ number: [ "one", "two" ]});
// with separateArrayItems: true
<number>
<one/>
<two/>
</number>
// with separateArrayItems: false
<number>one</number>
<number>two</number>
Removed the #list decorator. Array items are now created as child nodes by default.
#list decorator. Array items are now created as child nodes by default.- #list decorator ignores empty arrays.
#list decorator ignores empty arrays.Allow \r, \n and \t in attribute values without escaping. See #86.
\r, \n and \t in attribute values without escaping. See #86.Use native isArray instead of lodash.
isArray instead of lodash.Updated lodash dependency to 3.5.0.
Bumped version because previous release was not published on npm.
Updated lodash dependency to 3.5.0.
Updated lodash dependency to 3.3.0.
Fixed a bug where the XMLNode constructor overwrote the super class parent.
XMLNode constructor overwrote the super class parent.Updated lodash dependency to 3.2.0.
Updated lodash dependency to 3.1.0.
Updated lodash dependency to 3.0.0.
Show more information from attribute creation with null values.
Fixed prepublish script to run on windows.
Added the offset option to toString() for use in XML fragments.
offset option to toString() for use in XML fragments.Corrected license in package description.
Dropped performance test and memwatch dependency.
Fixed a bug where empty indent string was omitted when pretty printing. See #59.
Correct cases of pubID and sysID.
Convert objects to JS primitives while sanitizing user input.
Bumped version because previous release was not published on npm.
Removed duplicate null checks from constructors.
att() and ins().Removed performance tests from npm package.
Added support for the DTD and XML declaration.
clone includes attributes.Changed processing instruction decorator to ?.
?.Added processing instructions to JS object conversion.
Your coding agent can read these notes before it upgrades. Set up the MCP server →