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

@ai4privacy/ai4privacy

v0.1.0

Published

PII detection and masking using AI4Privacy transformer models

Readme

ai4privacy JavaScript module

A JavaScript/Node.js package for state-of-the-art PII detection and masking using AI4Privacy transformer models.

Features

  • Protect Mode: Anonymize text by replacing detected PII with placeholders.
  • Observe Mode: Get statistics and a detailed privacy mask of found PII without altering the original text.
  • Reidentify: Restore original values from masked text using the replacements list.
  • Multiple Models: English-specific, multilingual, and categorical detection.
  • Tunable Sensitivity: Adjustable scoreThreshold to balance detection accuracy.

Installation

npm install @ai4privacy/ai4privacy

Quick Start

import { protect } from "@ai4privacy/ai4privacy";

const maskedText = await protect("Email me at [email protected] or call me at +41763223001.");
console.log(maskedText);
// Expected: Email me at [PII_1] or call me at [PII_2]

Advanced Usage

Multilingual Support

import { protect } from "@ai4privacy/ai4privacy";

const masked = await protect("Je m'appelle Pierre et j'habite a Paris.", {
  multilingual: true,
});
console.log(masked);
// Expected: Je m'appelle [PII_1] et j'habite a [PII_2]

Categorical PII Detection

import { protect } from "@ai4privacy/ai4privacy";

const details = await protect("Senden Sie es an Eva Schmidt.", {
  classifyPii: true,
  verbose: true,
});
console.log(details.replacements.map((r) => r.label));
// Expected: ['GIVENNAME', 'SURNAME']

Observe Mode

import { observe } from "@ai4privacy/ai4privacy";

const report = await observe("My name is Alice and I live in Berlin.", {
  classifyPii: true,
});
console.log(JSON.stringify(report, null, 2));

Reidentify

import { protect, reidentify } from "@ai4privacy/ai4privacy";

const result = await protect("Contact John at [email protected]", { verbose: true });
const original = reidentify(result.maskedText, result.replacements);
console.log(original);
// Expected: Contact John at [email protected]

Adjusting Sensitivity

import { protect } from "@ai4privacy/ai4privacy";

// High precision
const highPrec = await protect("Maybe this is a name. Contact John.", {
  scoreThreshold: 0.5,
});

// High sensitivity
const highSens = await protect("Maybe this is a name. Contact John.", {
  scoreThreshold: 0.001,
});

Disclaimer

AI4Privacy is trained on the world's largest open-source privacy dataset. For production use, please evaluate results carefully on your own datasets. For assistance, contact us at https://ai4privacy.com or email [email protected].