NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2376 most downloaded on npm
A convertor between XML text and Javascript object / JSON text.
Last release 8 years ago
no release in 18 months
Ships fairly regularly
a new release about every 6 weeks
Rarely documented
notes for 8 of 49 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
49 releases · first in 2016
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Optimization done in js2xml routine that improves its performance for converting js object or json text to xml text. Thanks for the efforts https://gi
Optimization done in js2xml routine that improves its performance for converting js object or json text to xml text. Thanks for the efforts https://github.com/nashwaan/xml-js/pull/63 by @AirCrisp
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release adds a major feature that allows to pass in custom functions for additional processing.
This release adds a major feature that allows to pass in custom functions for additional processing.
Example to make all parsed element names in upper case:
var js = convert.xml2js(xml, {compact: false, elementNameFn: function(name) {
return name.toUpperCase();
}});
Nothing published for this version
This release supports a new option indentAttributes to indent attributes in the xml. See below example from this thread:
This release supports a new option indentAttributes to indent attributes in the xml. See below example from this thread:
<parent
bar="1"
baz="hello"
>
<child
attr1="a"
attr2="b"
/>
</parent>
Also, support for converting js object of {a: 'hi'} rather than {a: {_text: 'hi'}} to <a>hi</a>.
I previously didn't want to support this for the reasons outlined here.
I am allowing this behavior in this library as it can be safe to handle this scenario when transforming js2xml only.
xml2js conversion from <a>hi</a> to {a: 'hi'} rather than {a: {_text: 'hi'}} is still not supported as this could be dangerous for the reasons explained here.
Nothing published for this version
Nothing published for this version
Nothing published for this version
The new implementation can cause a slight breaking change:
This release addresses some issues on escaping entity codes (e.g &) in xml document.
The new implementation can cause a slight breaking change:
xml to js will decode the 5 entity codes & < > " ' into & < > " '. For example, & WILL be changed to & character (instead of keeping it &). Also, {sanitize: true} option is deprecated.js to xml will cause 3 characters & < > (instead of 5 characters) if found in node text to be transformed into & < >. And will cause 1 character " (instead of 5 characters) if found in node attribute to be transformed into ".For more discussion, see this issue.
Nothing published for this version
Nothing published for this version
Parsing of processing instructions such as <?go there?> and <?go to="there"?> are now supported. Note that for the second case, the parser by default
Parsing of processing instructions such as <?go there?> and <?go to="there"?> are now supported. Note that for the second case, the parser by default will not generate attributes unless flag {instructionHasAttributes: true} is set. See discussion for more details.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Setting {compact: true, alwaysArray: true} when converting from xml to js/json will always put sub-element (even if it is only one) into an array of o
Setting {compact: true, alwaysArray: true} when converting from xml to js/json will always put sub-element (even if it is only one) into an array of objects. This can simplify the client code a little so that it can always expect the content of an element is an array rather than checking everytime whether it is an array or object.
Also, multiple comments and multiple CDatas are now supported in compact mode.
Parsing of DOCTYPE is now supported but in a simple way: its content will be a string and will not be parsed further (see discussion).
DOCTYPE is now supported but in a simple way: its content will be a string and will not be parsed further (see discussion).{indentCdata: true}.First major and stable release.
First major and stable release.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →