Configurable Object to XML Converter for Node.js

Multithreaded JavaScript has been published with O'Reilly!

I just got my configurable Object to XML Node.js Converter uploaded to GitHub. The goal of the project is to make it easy to generate your response object in your API once, and then depending on the request accept header, either send the raw object or use this to convert that object into XML.

Without this module, you would either have to use a generic XML generator (which usually have some interesting side effects with naming), or manually create your XML object in every action (which is annoying). You can configure the module for your entire project if you use consistent settings (which is most likely what you'll want to do), or you can do it each time you generate an XML document.

The biggest feature IMO is that it generates plural element names for arrays, with each child being a singular element name, e.g.:

<objects>
  <object />
  <object />
  <object />
</objects>

Note, this project isn't hosted in my GitHub account, but as a project under the organization for the company I currently work at.

Thomas Hunter II Avatar

Thomas has contributed to dozens of enterprise Node.js services and has worked for a company dedicated to securing Node.js. He has spoken at several conferences on Node.js and JavaScript and is an O'Reilly published author.