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

censorship-id

v1.1.0

Published

A robust Indonesian profanity filter for detecting and masking inappropriate words.

Downloads

26

Readme

censorship-id

npm version License: MIT

A robust and simple npm package for detecting and masking Indonesian profanity, slang, and inappropriate words.

Features

  • Smart Detection: Optional smartMode to handle leetspeak (e.g., 4njing), repeated characters (e.g., baaaaaabiii), and punctuation insertion (e.g., a.n.j.i.n.g).
  • Comprehensive Dictionary: Pre-loaded with common Indonesian bad words.
  • Regex Powered: Uses word boundaries to avoid false positives (e.g., masking "tai" but not "pantai").
  • Customizable: Add your own words to the list and choose your mask character.
  • Keep First and Last: Option to keep the first and last letters visible for better context.
  • Case-Insensitive: Matches words regardless of their case.
  • Lightweight: Zero dependencies (only uses Jest for development).

Installation

npm install censorship-id

Usage

Basic Usage

const { censorId } = require('censorship-id');

const text = "Dasar anjing kau, babi!";
const censored = censorId(text);
console.log(censored); 
// Output: Dasar ****** kau, ****!

Advanced Usage (Options)

const { censorId } = require('censorship-id');

const text = "Dasar anjing kau, babi!";

// 1. Using a custom mask
const customMask = censorId(text, { mask: '#' });
console.log(customMask);
// Output: Dasar ###### kau, ####!

// 2. Keeping first and last letters
const visible = censorId(text, { keepFirstAndLast: true });
console.log(visible);
// Output: Dasar a****g kau, b**i!

// 3. Adding custom words to censor
const customWords = censorId("Kamu sangat malas!", { customWords: ['malas'] });
console.log(customWords);
// Output: Kamu sangat *****!

// 4. Smart Mode (handles leetspeak & repeats)
const smart = censorId("D4s4r 4njing!", { smartMode: true });
console.log(smart);
// Output: D4s4r ******!

const repeats = censorId("baaaaaaaabiiiiii", { smartMode: true });
console.log(repeats);
// Output: ****************

API Reference

censorId(text, options)

  • text (string): The input text to be filtered.
  • options (object): Optional configuration.
    • mask (string): The character used to mask words (default: *).
    • customWords (string[]): Additional words to censor.
    • keepFirstAndLast (boolean): If true, the first and last letters of the word remain visible (default: false).
    • smartMode (boolean): If true, detects leetspeak and repeated characters (default: false).

License

MIT © rheatkhs