Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@wikipathways/cxsd
Advanced tools
Streaming XSD parser and XML parser generator with TypeScript output
cxsd
is a streaming XSD parser and XML parser generator for Node.js and
(optionally but highly recommended) TypeScript.
It automatically downloads all referenced .xsd
files and outputs two files for each defined namespace:
.js
JavaScript code for Node.js containing a compact state machine table for the cxml parser..d.ts
TypeScript definition with JSDoc comments to help editors with tab completion, type verification and tooltips.Since namespaces map to source files, compiled namespaces can import others like normal JavaScript files.
cxml itself is highly advanced and unlike other JavaScript XML parsers. It fully supports namespaces, derived types and (soon) substitution groups. Output structure is defined mainly by schema, not the XML input. You can correctly parse files with completely unexpected structures (conditions apply) and element names, if they refer to a schema mapping the contents to supported equivalents.
echo '{ "scripts": { "cxsd": "cxsd" } }' > package.json
npm install cxsd
npm run cxsd http://schemas.opengis.net/wfs/1.1.0/wfs.xsd
The first line just sets up NPM to allow calling cxsd
without installing it globally. It also works on Windows if you omit the single quotes ('
).
This downloads 96 .xsd
files (total about 720 kilobytes) and produces 9 .js
files for the XML parser (total about 90 kilobytes)
and 9 .d.ts
files (total about 480 kilobytes) for TypeScript editors to statically verify the parser output is correctly used and generally help the programmer.
You can import the resulting .d.ts
and .js
files from TypeScript:
import * as wfs from './xmlns/www.opengis.net/wfs';
import * as ows from './xmlns/www.opengis.net/ows';
var metadata = wfs.document.WFS_Capabilities.OperationsMetadata;
See how the Atom editor with atom-typescript understands the code in the screenshot at the top.
.js
files call cxml
to parse themselves into JavaScript structures)
.d.ts
for working with source code)
C++
-based parsers out of XSD schema definitions.Copyright (c) 2015-2016 BusFaster Ltd
FAQs
Streaming XSD parser and XML parser generator with TypeScript output
The npm package @wikipathways/cxsd receives a total of 267 weekly downloads. As such, @wikipathways/cxsd popularity was classified as not popular.
We found that @wikipathways/cxsd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.