Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/okunishinishi/node-writexml

Node js mofule to generate xml
https://github.com/okunishinishi/node-writexml

Last synced: 2 months ago
JSON representation

Node js mofule to generate xml

Awesome Lists containing this project

README

        

writexml
==========

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/okunishinishi/node-svggen
[bd_travis_url]: http://travis-ci.org/okunishinishi/node-svggen
[bd_travis_shield_url]: http://img.shields.io/travis/okunishinishi/node-svggen.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/okunishinishi/node-svggen
[bd_travis_com_shield_url]: https://api.travis-ci.com/okunishinishi/node-svggen.svg?token=
[bd_license_url]: https://github.com/okunishinishi/node-svggen/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/okunishinishi/node-svggen
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/okunishinishi/node-svggen.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/okunishinishi/node-svggen.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/okunishinishi/node-svggen
[bd_gemnasium_shield_url]: https://gemnasium.com/okunishinishi/node-svggen.svg
[bd_npm_url]: http://www.npmjs.org/package/writexml
[bd_npm_shield_url]: http://img.shields.io/npm/v/writexml.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

Generate xml file from data.

Installation
-----

```bash
npm install writexml --save
```

Usage
----

```javascript
'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)
//
//
// 123-555-4567
// 789-555-4567
// 456-555-7890
//
})
})

```

License
-------
This software is released under the [MIT License](https://github.com/okunishinishi/node-svggen/blob/master/LICENSE).