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

@heroku/js-blanket

v1.0.0

Published

Framework-agnostic sensitive data scrubbing library for error monitoring and logging

Maintainers

srishtigautamsrishtigautamaklimaiteaklimaitejsullivandigsjsullivandigsjulianduque-sfdcjulianduque-sfdccwallsfcwallsfijanakijanakjeffrey.estradajeffrey.estradadlira-sfdlira-sfntonollierntonollierdaebumleedaebumleetetsuya_tetsuya_mttrmttrelearyelearysalesforce-releasessalesforce-releasesanujpandey001anujpandey001sripad.kulkarnisripad.kulkarnikbaird-sfkbaird-sfcbaxtersfcbaxtersfryoneyamaryoneyamaadirasanamadirasanamnrisaronrisarocmarcojoscmarcojosmgates-salesforcemgates-salesforceademusoyoademusoyoelzoonaelzoonajondaniel-sfdcjondaniel-sfdcdhagberg-sfdhagberg-sfbencdentonbencdentonmarcelsfdcmarcelsfdcccaseyccaseyjoeybrown90sfjoeybrown90sfsuppadasuppadadiana.doherty.sfdcdiana.doherty.sfdchritchhritchryanbrainardryanbrainardrsoerensenrsoerensenjasoncummings-herokujasoncummings-herokubrock-salesforcebrock-salesforcetkoh-sfdctkoh-sfdcgnettergnettercoreypurcell_salesforcecoreypurcell_salesforceswapnilghoseswapnilghosestessema-sfcstessema-sfcbrittany.jonesbrittany.jonesrstiltonsfrstiltonsfnilamuthunilamuthusghaffarsghaffarcdwort-sfdccdwort-sfdcaaronromeosfdcaaronromeosfdckpremkumarkpremkumarrchandarchandaxx-sfdc-npmxx-sfdc-npmcv88cv88ekozilforceekozilforceumarsfdcumarsfdcbeanieboibeanieboindavidson-sfndavidson-sfmingzhi-liu1258mingzhi-liu1258angelcampbellangelcampbellmandeepsfmandeepsfyann_ckyann_ckdasofieidasofieisudarshanhiraysudarshanhirayalex_herokualex_herokusbosio_sfsbosio_sfsarahoh2468sarahoh2468tlowrimoretlowrimoreptemporiniptemporinitcareysmith-sfdctcareysmith-sfdcrobinson.mrobinson.mdkabanov1dkabanov1rdagg-herordagg-herok80bowmank80bowmansheax0rsheax0rdpark.herokudpark.herokudaniel.brightdaniel.brightjdowningjdowningabhinavkoulabhinavkouljoshwlewis-sfdcjoshwlewis-sfdcviniljainviniljaineblackeblackk.plentyk.plentyapadalaapadalalsorstokkelsorstokkercrossrcrosskdreyerorenkdreyerorendhammer25dhammer25tenharmsel_sftenharmsel_sfdougmcinnes-sfdcdougmcinnes-sfdcchap-herokuchap-herokumichellejhlimmichellejhlimmbuschherokumbuschherokubeckychenbeckychensmrutisamantasmrutisamantaapoorvasrivapoorvasrivhsophie-sfhsophie-sfp.shreyap.shreyasai_harshitha_neelasai_harshitha_neelanlanattanlanattadreichenbergdreichenbergvlazukavlazukamarsmarsheroku-front-endheroku-front-endrichatiwaririchatiwariwchrisjohnsonwchrisjohnsonthe7okathe7okasimonebonettisfitasimonebonettisfitalucaszhoulucaszhoupsalimpsalimtaylor.jonestaylor.jonesangelayoungangelayoungktsforcektsforcekerry-bennettkerry-bennettgkomminenigkomminenismukusmukudgallegossfdcdgallegossfdcrishabh.wasonrishabh.wasonsarassassinsarassassinarajaarajav.anandv.anandlmckenzielmckenziejordaneekeyjordaneekeydaigo-herokudaigo-herokumimenmimenjwadsworthsfjwadsworthsfpfuentepfuentebleongbleongpaguilarpaguilarzli-sfzli-sfsruthichsruthichjesse.brown-sfjesse.brown-sftij005tij005tholschuh-salesforcetholschuh-salesforcemohammadfazil.shaikmohammadfazil.shaikricardoherokuricardoherokukumardinesh2kumardinesh2sherry.yaosherry.yaotholmes-sfdctholmes-sfdcpalakjeetkaur12palakjeetkaur12sfjonnpmsfjonnpmvjohnevjohnejinjutha.hancockjinjutha.hancockmgauger_herokumgauger_herokutdhayanandatdhayanandakharlowsfkharlowsfjhili!16jhili!16slizcoslizcoyasuhiro-herokuyasuhiro-herokuanna-crossanna-crosscromwellryan-sfcromwellryan-sfhyunwookleehyunwookleematthew.rossimatthew.rossitm-sftm-sfnkoziuknkoziukherokucodyherokucodydodom-sfdcdodom-sfdccsinghaus-sfdccsinghaus-sfdcjw-sfdcjw-sfdcjlopezdanjlopezdangsinghsfdcgsinghsfdcnrenkenrenkesalesforcegenesalesforcegenebsonntag-salesforcebsonntag-salesforcechetankd10chetankd10heroku-johnnyheroku-johnnyemilyhuang-herokuemilyhuang-herokumichael.malavemichael.malaveerika.wallaceerika.wallacevalluri056valluri056hk-ankitkumarhk-ankitkumarkaruna123karuna123mjoherson-sfmjoherson-sfskediyal-sfskediyal-sf

Readme

Heroku JS Blanket

A framework-agnostic sensitive data scrubbing library for logging, exception handling, and monitoring services for NodeJS and JavaScript projects. If you need to remove PII from structured data, JS Blanket has you covered.

This project provides a core scrubbing engine with preset field lists for common PII patterns, making it easy to integrate with any logging or error monitoring service.

Features

  • Deep Object Traversal: Handles nested objects, arrays, and circular references safely
  • Multiple Scrubbing Modes: Field-based, path-based, and pattern-based scrubbing
  • Immutable Operations: Never modifies input data - always returns new objects
  • Preset Field Lists: Battle-tested PII patterns (HEROKU_FIELDS, GDPR_FIELDS, PCI_FIELDS)

Quick Start

Installation

# npm
npm install @heroku/js-blanket

# pnpm
pnpm add @heroku/js-blanket

# yarn
yarn add @heroku/js-blanket

Usage Examples

Framework-specific examples here.

Core Scrubber API

The Scrubber class provides flexible PII scrubbing with three modes:

Field-Based Scrubbing

Scrubs values based on field names (exact match or regex):

import { Scrubber } from '@heroku/js-blanket';

const scrubber = new Scrubber({
  fields: ['password', 'apiToken', /.*_token$/i],
  replacement: '[REDACTED]',
});

const data = {
  user: 'john',
  password: 'secret123',
  oauth_token: 'abc-def-ghi',
};

const result = scrubber.scrub(data);
// Result: { user: 'john', password: '[REDACTED]', oauth_token: '[REDACTED]' }

Path-Based Scrubbing

Scrubs values at specific paths using dot notation:

const scrubber = new Scrubber({
  paths: ['user.email', 'user.profile.ssn'],
});

const data = {
  user: {
    name: 'John',
    email: '[email protected]',
    profile: { ssn: '123-45-6789' },
  },
};

const result = scrubber.scrub(data);
// Result: { user: { name: 'John', email: '[SCRUBBED]', profile: { ssn: '[SCRUBBED]' } } }

Pattern-Based Scrubbing

Scrubs content matching regex patterns:

const scrubber = new Scrubber({
  patterns: [
    /\b[\w._%+-]+@[\w.-]+\.[a-zA-Z]{2,}\b/g, // Email addresses
    /\b\d{3}-\d{2}-\d{4}\b/g, // SSN patterns
    /\b\d{13,19}\b/g, // Credit card numbers
  ],
});

const data = {
  message: 'Contact [email protected] or call 123-45-6789',
};

const result = scrubber.scrub(data);
// Result: { message: 'Contact [SCRUBBED] or call [SCRUBBED]' }

Preset Field Lists

Use battle-tested preset field lists for common PII patterns:

import { HEROKU_FIELDS, GDPR_FIELDS, PCI_FIELDS } from '@heroku/js-blanket';

// Heroku-specific sensitive fields
const scrubber = new Scrubber({
  fields: HEROKU_FIELDS, // heroku_oauth_token, sudo_oauth_token, www-sso-session, etc.
});

// GDPR compliance fields
const gdprScrubber = new Scrubber({
  fields: GDPR_FIELDS, // email, ip_address, phone_number, ssn, date_of_birth, etc.
});

// PCI compliance fields
const pciScrubber = new Scrubber({
  fields: PCI_FIELDS, // credit_card, cvv, card_number, expiration_date, etc.
});

// Combine multiple presets
const scrubber = new Scrubber({
  fields: [...HEROKU_FIELDS, ...GDPR_FIELDS, ...PCI_FIELDS],
});

Code Quality and Testing

This project uses pnpm for package management and includes comprehensive code quality tools to maintain high standards.

Available Scripts

A list of useful scripts when developing against the codebase:

# All code quality checks and tests
pnpm check

# Run the full test suite with coverage reporting
pnpm test

# Check code quality with ESLint
pnpm lint

# Automatically fix linting issues and format code with Prettier
pnpm format

# Run TypeScript type checking
pnpm type-check

# Run the continuous integration checks (linting, type checking, and tests)
pnpm ci

Development Workflow

For the best development experience:

  1. Before starting work: Ensure dependencies are installed with pnpm install.
  2. During development: Run pnpm type-check periodically to catch type errors early.
  3. Before committing: Run pnpm check to ensure all quality standards are met.
  4. Fix issues quickly: Use pnpm format to auto-fix formatting and linting issues.

Testing Requirements

Tests are located in src/**/*.test.ts and run against the compiled JavaScript in dist/. The test suite includes:

  • Unit tests for all public APIs
  • Type safety validation tests
  • Coverage reporting with c8 (HTML and text-summary)

Tests automatically run in silent mode (LOG_LEVEL=silent) to keep output clean.

Build Outputs

The library produces dual builds for maximum compatibility:

  • CommonJS (dist/cjs/): Use for Node.js and older bundlers
  • ES Modules (dist/esm/): Use for modern bundlers and tree-shaking support

Both outputs include TypeScript declaration files (.d.ts) for type information.

License

Apache-2.0. See LICENSE for details.

Contributing

We welcome issues and PRs. Please follow conventional commits, keep changes under 200 lines per commit, and ensure tests and type checks pass. See CONTRIBUTING.md for details.

Documentation

For more detailed examples and use cases: