npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@runsafesecurity/spdxcdx

v0.1.4

Published

SPDX to CycloneDX converter

Downloads

1,524

Readme

spdxcdx

Convert SPDX 2.x SBOMs to CycloneDX 1.6.

Library

import { readFile } from 'node:fs/promises';
import { parseSpdx, convertSpdxToCdx } from '@runsafesecurity/spdxcdx';

const spdx = await parseSpdx(await readFile('sbom.spdx'), {
  format: 'auto',
  fileName: 'sbom.spdx',
});
const cdx = await convertSpdxToCdx(spdx, { validate: true });

validate: true checks the result with @cyclonedx/cyclonedx-library (Ajv). Default is off.

JSON input requires Node only. Tag:value and RDF/XML input require Python 3 and pyspdxtools from spdx-tools on PATH.

CLI

yarn build
# Auto-detect JSON, tag:value, or RDF/XML input.
node dist/cli.js convert -i samples/spdx/minimal.spdx -o /tmp/out.cdx.json --validate
# Or select a format explicitly.
node dist/cli.js convert -i samples/spdx/minimal.spdx.rdf --input-format rdfxml -o /tmp/out.cdx.json --validate
# or, after install:
spdxcdx convert -i sbom.spdx.json --input-format json -o sbom.cdx.json --validate

Use - for stdin/stdout.

Field mapping

| Artifact | Path | |----------|------| | Mapping design | docs/superpowers/specs/2026-07-16-spdx-to-cdx-mapping-design.md | | Conversion engine design | docs/superpowers/specs/2026-07-16-spdx-to-cdx-conversion-engine-design.md | | Human matrices | docs/mapping/spdx-2-to-cdx-1.6.md | | Machine companion | src/mappings/spdx-2-to-cdx-1.6.yaml |

Development

yarn install
yarn test
yarn test:coverage
yarn build

Node >=26.5.0. Sample fixtures: samples/spdx/ (curated) and samples/spdx/real-world/ (downloaded open-source SPDX JSON SBOMs). Alternate-format integration tests require Python with spdx-tools==0.8.5 (pyspdxtools) on PATH; .venv-spdx is supported.

Contributing

Contributions are welcome. By submitting a contribution, you agree that:

  1. Changes maintain 100% code coverage (yarn test:coverage)
  2. Changes meet the project's lint standards (yarn lint:check)
  3. All contributions are MIT licensed

License

MIT