包详细信息

@arcjet/redact

arcjet3.4kApache-2.01.0.0-beta.9

Arcjet sensitive information redaction library

arcjet, redact, utility, util

自述文件

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://arcjet.com/logo/arcjet-dark-lockup-voyage-horizontal.svg"> Arcjet Logo </picture>

@arcjet/redact

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/%40arcjet%2Fredact?style=flat-square&label=%E2%9C%A6Aj&labelColor=000000&color=5C5866"> npm badge </picture>

Arcjet helps developers protect their apps in just a few lines of code. Implement rate limiting, bot protection, email verification, and defense against common attacks.

This is the Arcjet TypeScript and JavaScript sensitive information redaction library.

Installation

npm install -S @arcjet/redact

Reference

The full reference documentation can be found in the Arcjet docs.

Example

const text = "Hi, my name is John and my email adress is john@example.com";
const [redacted, unredact] = await redact(text, {
  redact: ["email", "phone-number"],
});
console.log(redacted);
// Hi, my name is John and my email address is <Redacted email #0>

const unredacted = unredact("Your email address is <Redacted email #0>");
console.log(unredacted); // Your email address is john@example.com

License

Licensed under the Apache License, Version 2.0.