
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
pci-dss-sanitizer
Advanced tools
You can use this synchronously
import sanitize from 'pci-dss-sanitizer';
const unsanitized_string = 'your string containing sensitive banking info';
const sanitized_string = sanitize(unsanitized_string);
Or you can use it as a stream (this is actually the recommended way to use this library)
import { createStream as createSanitizerStream } from 'pci-dss-sanitizer';
const unsanitized_stream = process.stdin;
const sanitized_stream = unsanitized_stream.pipe(createSanitizerStream())
sanitized_stream.pipe(process.stdout);
// you could also write this as a one-liner:
process.stdin.pipe(createSanitizerStream()).pipe(process.stdout);
Or if you're more into Promises/callbacks, you could use it as an async function
import { async as sanitizeAsync } from 'pci-dss-sanitizer';
const unsanitized_string = 'your string containing sensitive banking info';
const sanitized_promise = sanitizeAsync(unsanitized_string, your_optional_callback_here);
sanitized_promise.then(function(sanitized_string) {
...
});
Use npm run commit when you want to commit a change.
This project uses GitHub actions and semantic-release for creating releases.
To make a (temporary) release candidate, you can use the following commands:
# Create a new rc from the latest/remote develop
npm run release-candidate
or
# Create a new rc from a specific branch
npm run release-candidate -- feature/SKED-XXXX
That command will make a new rc branch (locally and remotely) on which semantic-release is configured
to create a new release candidate (see .releaserc).
Since semantic-release is currently configured to run on any push'es to master,
creating and merging a GitHub Pull Request into master will trigger a new release automatically.
Typically we do this via a temporary release/next or release/SKED-XXXX branch and creating a PR via GitHub UI.
This repostiory uses TSDX for development.
TSDX scaffolds your new library inside /src.
To run TSDX, use:
npm start # or yarn start
This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.
To do a one-off build, use npm run build or yarn build.
To run tests, use npm test or yarn test.
Jest tests are set up to run with npm test or yarn test.
TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.
tsconfig.json is set up to interpret dom and esnext types. Adjust according to your needs.
Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:
// ./types/index.d.ts
declare var __DEV__: boolean;
// inside your code...
if (__DEV__) {
console.log('foo');
}
You can also choose to install and use invariant and warning functions.
CJS, ESModules, and UMD module formats are supported.
The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.
FAQs
Mask bank card info from strings
The npm package pci-dss-sanitizer receives a total of 55 weekly downloads. As such, pci-dss-sanitizer popularity was classified as not popular.
We found that pci-dss-sanitizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.