Newfangled Package Modernizer
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    simplejs2xmlpublic

    node-js2xml (simplejs2xml)

    This provides a very simple JavaScript to XML module for node.js, based on the Genx package.

    The intent is only to provide a very basic serialization at this time, some options are available

    Install

    The usual, npm, add a dependency in your package.json to simplejs2xml and run:

    $ npm install
    

    API

    The module only supports a single method, toXml(object, [options]) that will perform a simple serialization of the passed in JavaScript object.

    var xml = require('simplejs2xml');
     
    var serialized = xml.toXml({name: 'example', version: 3}, {});

    The following options are supported:

    • rootName - where the passed object is a JavaScript object we do not have an element name by default, we would typically emit js:Object however you can pass in a name string to override this.
    • defaultUrl - the namespace URL for elements generated by the module for anonymous objects, arrays and values (default http://www.example.org/js2xml).
    • defaultPrefix - the namespace prefix for elements generated by the module for anonymous objects, arrays and values (default js).

    Examples

    TBD

    Keywords

    none

    install

    npm i simplejs2xml

    Downloadslast 7 days

    4

    version

    0.1.2

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar