
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Simple non-compiant XML parser because we just need to parse some basic responses and libxml takes forever to compile :D you probably don't want to use this unless you also have similar needs.
$ npm install xml-parser
JavaScript:
var fs = require('fs');
var parse = require('xml-parser');
var xml = fs.readFileSync('examples/developerforce.xml', 'utf8');
var inspect = require('util').inspect;
var obj = parse(xml);
console.log(inspect(obj, { colors: true, depth: Infinity }));
XML:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:enterprise.soap.sforce.com">
<soapenv:Body>
<createResponse>
<result>
<id>003D000000OY9omIAD</id>
<success>true</success>
</result>
<result>
<id>001D000000HTK3aIAH</id>
<success>true</success>
</result>
</createResponse>
</soapenv:Body>
</soapenv:Envelope>
Yields:
{ declaration: { attributes: { version: '1.0', encoding: 'utf-8' } },
root:
{ name: 'soapenv:Envelope',
attributes:
{ 'xmlns:soapenv': 'http://schemas.xmlsoap.org/soap/envelope/',
xmlns: 'urn:enterprise.soap.sforce.com' },
children:
[ { name: 'soapenv:Body',
attributes: {},
children:
[ { name: 'createResponse',
attributes: {},
children:
[ { name: 'result',
attributes: {},
children:
[ { name: 'id',
attributes: {},
children: [],
content: '003D000000OY9omIAD' },
{ name: 'success', attributes: {}, children: [], content: 'true' } ],
content: '' },
{ name: 'result',
attributes: {},
children:
[ { name: 'id',
attributes: {},
children: [],
content: '001D000000HTK3aIAH' },
{ name: 'success', attributes: {}, children: [], content: 'true' } ],
content: '' } ],
content: '' } ],
content: '' } ],
content: '' } }
MIT
FAQs
the little xml parser that could
The npm package xml-parser receives a total of 59,346 weekly downloads. As such, xml-parser popularity was classified as popular.
We found that xml-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.