writexml

3.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i writexml

Weekly Downloads

3

Version

3.0.0

License

MIT

Unpacked Size

10.2 kB

Total Files

16

Last publish

Collaborators

  • okunishinishi