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

@dbom/sdk

v1.2.0

Published

Node SDK for DBoM

Readme

DBoM Node SDK

The DBoM SDK for Node.js provides a high level API to interact with a DBoM node. The SDK is designed to be used in the Node.js JavaScript runtime.

Table of Contents

Getting Started

Prerequisites

To build and test, the following prerequisites must be installed first:

  • Node.js, version 12 is supported from 12.13.1 and higher
  • npm tool version 6 or higher

Development

Clone the project and launch the following commands to install the dependencies and perform various tasks.

In the project root folder:

  • Install all dependencies via npm install
  • To run the unit tests, use npm run test

Usage

The DBoM SDK is available on NPM and can be used as described below

Example:

Install the dbom-sdk

npm install @dbom/sdk

The DBoM SDK can now be imported:

const DbomNode = require('@dbom/sdk');
let dNode = new DbomNode('<gateway-uri>', '<optional-signing-service-uri>', '<optional-api-key>');

Create and Update Asset

let repoID = 'DB1',
    channelID = 'C1',
    assetID = 'ABC01',
    assetBody = {
        "standardVersion": 1.0,
        "documentName": "BoM for CPU Core i5 3500k",
        "documentCreator": "Intel FAB California",
        "documentCreatedDate": "2020-03-19",
        "assetType": "HardwareComponent",
        "assetSubType": "CPUUnit",
        "assetManufacturer": "Intel Corporation",
        "assetModelNumber": "BX80677I57500",
        "assetDescription": "Core i5 3500k Desktop Processor",
        "assetMetadata": {
            "clockSpeed": "3.4Ghz",
            "cpuSocket": "LGA 1151",
            "physicalCoreCount": "4",
            "supportedMemoryType": "DDR4SDRAM",
            "packageWattage": "65",
            "packageWeight": "340g"
        },
        "manufactureSignature": "wsBcBAEBCAAQBQJecxBBCRDhB93OjBXccAAAlAQH/0N2HhaK6fmADG0QxK9i8xIrgncGzvii6OqPzyVtyjA7RrpgA1c5E5wN5eW8XmPaqpMvtP3RenuTlXTH2d647QnzdxYuNOKjVXGuweBMkBqnKBf8hHeH6adBTh6Jlnbt3OndMsE06BMBz59Z/X4tmKoAWXox1EPraAi9+A6BqeB5YHXDQJ6SXsW9fLKoQVECsi0MHOR+CjGcu1R1dyP5s2Vd9jcm+DLXLmxz6zTqS7h1neLMsFm4jIhxYsh5mQ49R4r6Yi76RIMK5G6LxX32BzKb9rTDSKdqRFQAv4JsoZXTPRwlM3MG/FCQWYhtvc6righlAMJOVSXTxy54TPKeXe4==SVL1"
    };

(async () => {
    try {
        // Create an asset
        await dNode.createAsset(repoID, channelID, assetID, assetBody);

        // Retrive the asset from the gateway
        let asset = await dNode.getAsset(repoID, channelID, assetID);

        // Update the asset
        asset.assetMetadata.supportedMemoryType = 'DDR5SDRAM';
        await dNode.updateAsset(repoID, channelID, assetID, assetBody);
    } catch (e) {
        console.log('ERROR:', e);
    }
})();

Attach or Detach SubAsset

// Attaches a child asset to the provided parent asset
let attachRes = await attachSubasset(parentRepoID, parentChannelID, parentAssetID,
    childRepoID, childChannelID, childAssetID,
    role, subRole);
console.log(attachRes);

// Detaches a child asset from the provided parent asset
let detachRes = await detachSubasset(parentRepoID, parentChannelID, parentAssetID,
    childRepoID, childChannelID, childAssetID);
console.log(detachRes);

Validate or Audit the Asset

// Validates the manufacturer signature of an asset via the DBoM Node
let validate = await dNode.validateAsset(repoID, channelID, assetID);
console.log(validate);

// Get the audit trail of an asset via the DBoM Node
let audit = await dNode.auditAsset(repoID, channelID, assetID);
console.log(audit);

Docs

The SDK is annotated with JSDoc Comments. In order to generate HTML documentation run:

npm run generate-docs

Getting help

If you have any queries on the dbom-node-sdk, feel free to reach us on any of our communication channels

If you have questions, concerns, bug reports, etc, please file an issue in this repository's issue tracker.

Getting involved

Find the instructions on how you can contribute in CONTRIBUTING.