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

@hmcts/opal-frontend-common-node

v0.0.25

Published

Common nodejs library components for opal

Readme

OPAL Frontend Common Node Library

npm version License Quality Gate Status

This is a shared Node.js library containing common middleware, configurations, and utilities used across OPAL backend services.

Table of Contents

Getting Started

Prerequisites

Ensure you have the following installed:

Install Dependencies

yarn

Build Process

Run the following to build the project:

yarn build

The compiled output will be available in the dist/ folder. It includes index.js, type declarations, and any exported modules listed in the exports field.

Switching Between Local and Published Versions

See opal-frontend for how this library is consumed in practice.

Use the yarn import:local:common-node-lib and yarn import:published:common-node-lib scripts in your consuming project (opal-frontend) to switch between local development and the published npm version of the library.

To use a published version of this library during development in another project:

  1. In the consuming project, run:
    yarn import:published:common-node-lib

To use a local version of this library during development in another project:

  1. Build this library:

    yarn build
  2. In your consuming project (e.g. opal-frontend), ensure you have set an environment variable pointing to the local build:

    # In your shell config file (.zshrc, .bash_profile, or .bashrc)
    export COMMON_NODE_LIB_PATH="[INSERT PATH TO COMMON NODE LIB DIST FOLDER]"
  3. In the consuming project (e.g. opal-frontend), run:

    yarn import:local:common-node-lib

    This will remove the published version and install the local build using the path provided.

  4. To switch back to the published version:

    yarn import:published:common-node-lib

This setup makes it easy to switch between development and production versions of the shared library.

Publish the library

Once any changes have been approved and merged into the main branch, you'll need to publish a new version of the library so that it can be consumed by other projects. To do this:

  1. Increment the version number in both the library's root package.json.
  2. Commit and push those changes to the main branch.
  3. On GitHub, create a new release and use the updated version number as a tag.
  4. When the release workflow completes, the library will be published.

After this new version of the library is published, any consuming application should remove the local or outdated version of the library and then install the published version by running:

```bash
yarn import:published:common-node-lib
```

Linting and Formatting

To lint and check formatting:

yarn lint

There is a custom lint rule for member ordering to ensure members in the code are ordered in the following format:

[
  "private-static-field",
  "protected-static-field",
  "public-static-field",
  "private-instance-field",
  "protected-instance-field",
  "public-instance-field",
  "constructor",
  "private-static-method",
  "protected-static-method",
  "public-static-method",
  "private-instance-method",
  "protected-instance-method",
  "public-instance-method"
]

To fix formatting issues automatically:

yarn prettier:fix

Exports

This library exposes multiple entry points under the exports field of package.json. Example usage:

import { CSRFToken } from '@hmcts/opal-frontend-common-node/csrf-token';
import { AppInsights } from '@hmcts/opal-frontend-common-node/app-insights';
import { Helmet } from '@hmcts/opal-frontend-common-node/helmet';
import { LaunchDarkly } from '@hmcts/opal-frontend-common-node/launch-darkly';
import {
  ExpiryConfiguration,
  RoutesConfiguration,
  SessionStorageConfiguration,
  TransferServerState,
} from '@hmcts/opal-frontend-common-node/interfaces';

Refer to the exports block in package.json for the full list of available modules.

Commonly Used Commands

The following commands are available in the package.json:

  • yarn build
    Cleans the dist/ folder, compiles TypeScript, and copies relevant files to dist/.

  • yarn clean
    Removes the dist/ directory.

  • yarn lint
    Runs ESLint across the src/ directory and checks formatting using Prettier.

  • yarn prettier
    Checks if files are formatted correctly.

  • yarn prettier:fix
    Automatically formats the codebase.