1.0.2 • Published 6 years ago

specific-xml-gen v1.0.2

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

Specific XML Gen

Build Status

This project is meant to generate XML based on a JavaScript object.

Installation

npm install --save specific-xml-gen

Usage

Just the object

const parser = require('specific-xml-gen')

const xml = parser({
  prop1: 4,
  props: [
    { a: 'b' },
    { z: true },
  ],
})

console.log(xml)
// <prop1>4</prop1>
// <props>
// <prop>
// <a>b</a>
// </prop>
// <prop>
// <z>true</z>
// </prop>
// </props/>

Capitalizing tags

const parser = require('specific-xml-gen')

const xml = parser(
  {
    prop1: 4,
    props: [
      { a: 'b' },
      { z: true },
    ],
  },
  true
)

console.log(xml)
// <Prop1>4</Prop1>
// <Props>
// <Prop>
// <A>b</A>
// </Prop>
// <Prop>
// <Z>true</Z>
// </Prop>
// </Props/>
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago