Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.