tessl install tessl/npm-libnpmorg@8.0.0Programmatic API for managing npm organization memberships and roles
Agent Success
Agent success rate when using this tile
74%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.97x
Baseline
Agent success rate without this tile
76%
Build a small CLI helper that exports a Software Bill of Materials for a Node.js project using the npm toolchain. The helper must allow callers to choose the SBOM format, scope to specific workspaces, and control dependency omission and lockfile-only behavior.
"cyclonedx" and an output path provided, the helper writes the generated SBOM JSON to that path and the saved document includes CycloneDX format metadata (for example a bomFormat field set to CycloneDX). @test"cyclonedx" or "spdx", the helper rejects with a clear error that lists the allowed formats. @test@generates
/**
* Generates a Software Bill of Materials for a project using the npm CLI.
*
* @param {Object} options
* @param {'cyclonedx'|'spdx'} options.format - Required output format.
* @param {string} options.outputPath - Absolute or relative path where the SBOM JSON will be written.
* @param {string[]} [options.workspaces] - Optional workspace names to scope the SBOM; empty/undefined targets the whole project.
* @param {('dev'|'optional'|'peer')} [options.omit] - Optional omit class to filter dependencies.
* @param {boolean} [options.lockfileOnly] - Whether to rely on the lockfile/virtual tree; error if missing.
* @param {string} [options.cwd] - Directory to run in; defaults to process.cwd().
* @returns {Promise<{ outputPath: string, format: 'cyclonedx'|'spdx' }>}
*/
export async function generateSbom(options)Used to invoke the SBOM generator with format selection, workspace scoping, omit filters, and lockfile-only mode. @satisfied-by