New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

confusables

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confusables

A library to interact with Unicode Confusables in strings.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
increased by1.38%
Maintainers
1
Weekly downloads
 
Created
Source

npm MIT gzip size

Confusables

This library allows you to replace confusables in a string with their lookalike English character.

Try it out: https://confusables.netlify.com/

Purpose

When you need to filter/check English text and want any characters that look very similar to English characters, to be converted into those English characters. It does not support other languages - it's not possible to support other languages whilst remaining very practical/effective at normalizing for English.

The main purpose is for filtering profanity: users can easily bypass most filters by changing "fuck" to "fück", this stops that.

Installation

yarn add confusables

npm install confusables

Usage

Removing confusables

import remove from 'confusables'; 

remove('Ἢἕļľᦞ ш٥ṟlᑰ! Hello World!'); // => Hello World! Hello World!
remove('Iлtèrnåtïonɑlíƶatïǫԉ'); // => Internationalization

Injecting random confusables

import { obfuscate } from 'confusables'; // with ES modules

obfuscate('Hello World!'); // => Ḣé𝑙ŀ𝟶 Ꮤᴑ𝖗łᏧ
obfuscate('Internationalization'); // => ᶦṅᵗᧉ𝘳𝓃ȧťί𝙾ቢค𝞲ἱƶ𝜶ナἰøʼn

FAQs

Package last updated on 03 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc