Skip to content

Open source · MIT licensed

Nepali profanity filter
to keep it civil.

Detect and censor abuse in English, Romanized Nepali and Devanagari.

npm install no-nepali-profanity

Try it on real comments.

Strictness

check(text, { strictness }).censor()

yo ****** payment app kahiley chaley po

Flagged: khatey

400+

words, stems and phrases

8 KB

gzipped

0

dependencies

Made for how Nepal types.

People write Nepali in two scripts, mix in English, and dodge filters on purpose. A word list built for English misses all of it.

Reads through the dodges.

Leetspeak, symbols in place of letters, stretched and spelled-out words are all read as the word underneath.

  • sh1tcaught
  • sh!tcaught
  • f*ckcaught
  • fuuuuckcaught
  • f.u.c.kcaught
  • FUCKcaught

Knows Nepali grammar.

Postpositions and plurals glued to a word don't hide it, in either script.

  • mujikocaught
  • gedaharucaught
  • मुजीकोcaught
  • गेडाहरूcaught

Leaves names alone.

Real names that happen to contain a swear are checked in the test suite and pass.

  • Shitijclean
  • Kshitijclean
  • Randipclean
  • Kandelclean
  • Putaliclean
  • Ashaclean

Censors in place.

Masks exactly what was typed, down to the dots, and leaves the rest of the text as it was.

BeforeF.U.C.K this Sh1t!

After******* this ****!

Strict when you need it.

Three levels decide how much is caught. Pick one per filter.

Adds milder insults like idiot, murkha and sala. The default.

A few lines. That's it.

One import, plain functions, TypeScript types included. No setup, no API keys, no network calls.

import { censor } from "no-nepali-profanity";

censor("you muji");  // "you ****"
censor("F.U.C.K this Sh1t!");  // "******* this ****!"
censor("मुजीको क्लास");  // "*** क्लास"

One lexicon. Every stack.

Each port shares the same word lists and matching rules, so a comment gets the same result in every language.

JavaScript

npm

Python

PyPI

Go

Go modules

PHP

Packagist

Flutter & Dart

pub.dev

It won't catch every bad word.

Slang changes fast, and no word list is ever complete. If something slips through, or a real name gets flagged, open an issue or add the word yourself. Reviews from native Nepali speakers help the most.