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

@brightchain/brightchain-api-lib

v0.31.0

Published

This library was generated with [Nx](https://nx.dev).

Downloads

690

Readme

brightchain-api-lib

This library was generated with Nx.

Overview

brightchain-api-lib provides API-specific functionality for BrightChain. It extends base constants from @digitaldefiance/node-express-suite and adds API-specific constants.

Constants Architecture

Base Constants (from @digitaldefiance/node-express-suite)

The library uses createExpressConstants() from @digitaldefiance/node-express-suite, which provides:

  • PBKDF2: Password-based key derivation configuration
  • CHECKSUM: SHA3 checksum configuration
  • FEC: Forward error correction settings
  • KEYRING: Keyring algorithm configuration
  • ENCRYPTION: Encryption settings
  • Express Configuration: Express app settings, CORS, CSP, etc.
  • JWT: Base JWT configuration
  • Session: Session management settings

API-Specific Constants

The library defines the following API-specific constants:

WRAPPED_KEY

Constants for wrapped key operations:

import { Constants } from 'brightchain-api-lib';

Constants.WRAPPED_KEY.SALT_SIZE         // 32
Constants.WRAPPED_KEY.IV_SIZE           // 16
Constants.WRAPPED_KEY.MASTER_KEY_SIZE   // 32
Constants.WRAPPED_KEY.MIN_ITERATIONS    // 100000

Usage Examples

Importing Constants

import { Constants } from 'brightchain-api-lib';

// Access base constants (from @digitaldefiance/node-express-suite)
const corsOrigin = Constants.CORS.ORIGIN;
const jwtSecret = Constants.JWT.SECRET;

// Access API-specific constants
const saltSize = Constants.WRAPPED_KEY.SALT_SIZE;

Using with Environment Class

import { Environment } from 'brightchain-api-lib';

// Environment class extends BaseEnvironment from @digitaldefiance/node-express-suite
const env = new Environment();

// Access environment variables
const port = env.port;
const nodeEnv = env.nodeEnv;

Environment Class

The Environment class extends BaseEnvironment from @digitaldefiance/node-express-suite, providing:

  • Automatic loading of environment variables from .env files
  • Type-safe access to environment variables
  • Validation of required environment variables
  • Integration with Constants object
import { Environment } from 'brightchain-api-lib';

const env = new Environment('.env');

// BaseEnvironment provides standard variables
console.log(env.port);           // PORT from .env
console.log(env.nodeEnv);        // NODE_ENV from .env
console.log(env.jwtSecret);      // JWT_SECRET from .env

// Add BrightChain-specific variables as needed

Backward Compatibility

The refactored constants maintain full backward compatibility. All previously exported constant names remain accessible.

Building

Run nx build brightchain-api-lib to build the library.

Running unit tests

Run nx test brightchain-api-lib to execute the unit tests via Jest.

Migration Guide

If you're updating from a previous version of brightchain-api-lib, see MIGRATION.md for detailed migration instructions.