Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.83 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.83 KB
Arcjet Logo

@arcjet/redact

npm badge

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 [email protected]";
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.