3.0.0 • Published 5 years ago

writexml v3.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

writexml

Build Status npm Version JS Standard

Generate xml file from data.

Installation

npm install writexml --save

Usage

'use strict'

const fs = require('fs')
const writexml = require('writexml')

writexml('person-file.xml', 'person', {
  'telephone': [
    '123-555-4567',
    {
      '#': '789-555-4567',
      '=': 'fax'
    },
    '456-555-7890'
  ]
}).then(() => {
  /* ... */
  fs.readFile('person-file.xml', (err, content) => {
    console.log(content)
    // <?xml version='1.0' encoding='UTF-8'?>
    // <person>
    //     <telephone>123-555-4567</telephone>
    //     <fax>789-555-4567</fax>
    //     <telephone>456-555-7890</telephone>
    // </person>
  })
})

License

This software is released under the MIT License.