
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
devkits-json-xml
Advanced tools
Convert between JSON and XML formats — bidirectional converter, zero dependencies
Convert between JSON and XML formats. Bidirectional converter with zero dependencies.
npm install -g devkits-json-xml
# JSON to XML
jsonxml to-xml '{"name":"Alice","age":30}'
jsonxml to-xml '{"items":[1,2,3]}' -r data
# XML to JSON
jsonxml to-json '<root><name>Alice</name></root>'
# Custom options
jsonxml to-xml '{"a":1}' -r custom -i 4
const { jsonToXml, xmlToJson } = require('devkits-json-xml');
// JSON to XML
const xml = jsonToXml({ name: 'Alice', age: 30 });
console.log(xml);
// <root>
// <name>Alice</name>
// <age>30</age>
// </root>
// XML to JSON
const json = xmlToJson('<root><name>Alice</name></root>');
console.log(json);
// { root: { name: 'Alice' } }
// Custom root and indent
jsonToXml({ a: 1 }, 'data', ' ');
| JSON | XML |
|---|---|
{"key": "value"} | <key>value</key> |
{"key": 123} | <key>123</key> |
{"key": null} | <key/> |
{"key": []} | <key/> |
{"key": [1,2]} | <key><item>1</item><item>2</item></key> |
| Nested objects | Nested elements |
| XML | JSON |
|---|---|
<key>value</key> | { key: "value" } |
<key>123</key> | { key: 123 } |
<key/> | { key: "" } |
<key attr="1"/> | { key: { "@attr": "1" } } |
<a><b>1</b></a> | { a: { b: 1 } } |
| Option | Alias | Default | Description |
|---|---|---|---|
--root | -r | root | Root element name |
--indent | -i | 2 | Indentation spaces |
# Simple object
$ jsonxml to-xml '{"name":"DevKits"}'
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name>DevKits</name>
</root>
# Nested object
$ jsonxml to-xml '{"user":{"name":"Alice","age":30}}'
<?xml version="1.0" encoding="UTF-8"?>
<root>
<user>
<name>Alice</name>
<age>30</age>
</user>
</root>
# Array
$ jsonxml to-xml '{"items":[1,2,3]}'
<?xml version="1.0" encoding="UTF-8"?>
<root>
<items>
<item>1</item>
<item>2</item>
<item>3</item>
</items>
</root>
# XML to JSON
$ jsonxml to-json '<user><name>Alice</name><age>30</age></user>'
{
"user": {
"name": "Alice",
"age": 30
}
}
@🔍 Build something amazing? Check out API Monitor — simple, affordable API monitoring for indie hackers. Get alerted before your customers notice. Just $9/mo.
If you find this tool useful, please consider supporting the project:
Become a sponsor: Open Collective - DevKits
Prefer crypto? We accept:
0xDea4a6A20fCB44467e45Ef378972F54B22dC59db0xDea4a6A20fCB44467e45Ef378972F54B22dC59dbDonation Perks:
After donating, email your transaction hash to devkits@aiforeverthing.com to claim perks.
MIT — DevKits Team
FAQs
Convert between JSON and XML formats — bidirectional converter, zero dependencies
We found that devkits-json-xml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.