json2xml

Simple JavaScript Object to XML string converter.

4 个版本
安装
npm install json2xml
yarn add json2xml
pnpm add json2xml
bun add json2xml
README

node-json2xml

Description

Simple JavaScript Object to XML string converter.

Installation

Simplest way to install json2xml is to use npm, just npm install json2xml which will download json2xml and all dependencies.

Simple usage

var json2xml = require('json2xml');
json2xml({a:1});
//<a>1</a>

Options

add header:

json2xml({a:1}, { header:true });
//<?xml version="1.0" encoding="UTF-8"?><a>1</a>

add node attributes:

json2xml({a:1, attr:{b:2,c:3 }}, { attributes_key:'attr' });	
// <a b="2" c="3" >1</a>
版本列表
0.1.3 2016-11-14
0.1.2 2015-06-19
0.1.1 2013-09-18
0.0.1 2011-06-09