
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
create-xml-ls
Advanced tools
Another JS object to XML converter
npm install create-xml-ls
var createXml = require('create-xml-ls');
createXml({
something: {
is: 'very',
ugly: {
$attr: {
IMHO: 'it sucks'
}
but: 'sometimes we have to live with it'
}
}
}, { pretty: true });
/* =>
<?xml version="1.0" encoding="UTF-8"?>
<something>
<is>very</is>
<ugly IMHO="it sucks">
<but>sometimes we have to live with it</but>
</ugly>
</something>
*/
Indentation is off by default, but can be toggled with options.pretty
set
to true.
The default attributes key is '$attr'
, but you can also use a custom one
by setting options.attributesKey
to the desired key.
createXml({
something:
is: {
attributes: {
'kind': 'of'
},
interesting: 'about this'
}
}, { pretty: true, attributesKey: 'attributes' );
/* =>
<?xml version="1.0" encoding="UTF-8"?>
<something>
<is kind="of">
<interesting>about this</interesting>
</is>
</something>
*/
There's also support for array properties.
createXml({
arrayExample: {
sometimes: [
'I',
'had',
'to',
'do',
'this'
]
}
}, { pretty: true });
/* =>
<?xml version="1.0" encoding="UTF-8"?>
<arrayExample>
<sometimes>I</sometimes>
<sometimes>had</sometimes>
<sometimes>to</sometimes>
<sometimes>do</sometimes>
<sometimes>this</sometimes>
</arrayExample>
*/}
Copyright (c) 2013 Pedro Yamada. Licensed under the MIT license.
FAQs
Another JS object to XML converter
The npm package create-xml-ls receives a total of 13 weekly downloads. As such, create-xml-ls popularity was classified as not popular.
We found that create-xml-ls 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.