
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
xml-convert
Advanced tools
Another simple xml converter from js objects.
This package only exports one function obj2xml where you can pass a structured javascript object and it outputs some xml.
The input object must be structured as follows:
export interface XMLObject {
tag: string
attrs?: { [attr: string]: string | number }
content?: string | XMLObject[]
}
Content can either be a string (for just a text inside xml tags) or multiple other XMLObjects in an array.
import { obj2xml } from 'xml-convert'
obj2xml({
tag: 'test',
attrs: { a: 'b', b: 'c', d: 1 },
content: [
{
tag: 'test2',
attrs: { e: 'f' },
content: [{ tag: 'test2_1', attrs: { g: 'h' } }],
},
{ tag: 'test3', attrs: { f: 'g' }, content: 'nested' },
],
})
/*
<?xml version="1.0" encoding="utf-8"?>
<test a="b" b="c" d="1">
<test2 e="f">
<test2_1 g="h"/>
</test2>
<test3 f="g">nested</test3>
</test>
*/
FAQs
Another simple xml converter from js objects.
The npm package xml-convert receives a total of 33 weekly downloads. As such, xml-convert popularity was classified as not popular.
We found that xml-convert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.