Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
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 5 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.