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

unicode-text-obfuscator

v1.0.5

Published

Tiny utility to obfuscate and deobfuscate text by replacing characters with Unicode lookalikes.

Readme

unicode-text-obfuscator

npm license CI

Tiny, zero-dependency utility to obfuscate and deobfuscate text by replacing ASCII characters with visually similar Unicode lookalikes (Cyrillic, Greek, fullwidth, etc.). Useful for demo data, playful text effects, or making text look “weird” while still readable.


Table of Contents


Overview

What it does
This package replaces ASCII characters in text with visually similar Unicode lookalikes, and provides a best-effort deobfuscate function to map them back.

Use cases

  • Demo/test data
  • Playful UI effects
  • Generate visually distinct IDs or names

⚠️ Not for security/encryption purposes.


Installation

npm install unicode-text-obfuscator       # Local project
npm install -g unicode-text-obfuscator    # Global CLI
npm install github:lemonade-21/unicode-text-obfuscator  # Direct from GitHub

Quick Start

const { obfuscate, deobfuscate } = require('unicode-text-obfuscator');

const original = 'Hello world 123';
const ob = obfuscate(original);
console.log('ob:', ob);

console.log('deobfuscated:', deobfuscate(ob));

console.log(obfuscate(original, { fraction: 0.5 }));
console.log(obfuscate(original, { preserveDigits: true }));

ES module import:

import { obfuscate, deobfuscate } from 'unicode-text-obfuscator';

API Reference

obfuscate(text, options)

  • textstring | any
  • options{ fraction?: number, preserveDigits?: boolean }
  • Returnsstring
obfuscate('Hello world', { fraction: 0.5, preserveDigits: true });

deobfuscate(text)

  • textstring | any
  • Returns — best-effort ASCII string
deobfuscate('Hеllo wσrld');

CLI Reference

text-obfuscator "Hello world" [--fraction=0.5] [--preserve-digits] [--deobfuscate]

Examples

text-obfuscator "Hello world"
text-obfuscator "Hello world" --fraction=0.4
text-obfuscator "User 123" --preserve-digits
text-obfuscator "Hеllo wσrld" --deobfuscate

Advanced Examples

  • Partial obfuscation: fraction: 0.5
  • Preserve digits: preserveDigits: true
  • Obfuscating filenames or slugs
  • Deterministic obfuscation via custom random seed (advanced)

Edge Cases & Limitations

  • Font-dependent rendering
  • Not all characters round-trip perfectly
  • Surrogate pairs/emoji not modified
  • Obfuscated text differs at byte level

Performance

  • O(n) in string length
  • Fast for typical CLI or small UI use
  • For large text, process by line/chunk

Security & Privacy

  • Not encryption: treat as plaintext
  • Offline, zero-dependency, safe
  • Do not use to store secrets

Troubleshooting & FAQ

  • Deobfuscation may not fully restore text due to mapping limitations
  • Fonts may render some lookalikes identically
  • Deterministic output requires custom random seed

Tests & Development

node test.js        # smoke test
npm link            # test CLI locally

Add Jest or Node asserts for more robust testing.


Releasing & Versioning

Semantic versioning: patch.minor.major

npm version patch
git push --follow-tags
npm publish

GitHub Actions example: auto-publish on v*.*.* tags using NPM_TOKEN.


TypeScript Definitions

export interface ObfuscateOptions {
  fraction?: number;
  preserveDigits?: boolean;
}
export function obfuscate(text: string | any, options?: ObfuscateOptions): string;
export function deobfuscate(text: string | any): string;

Contribution Guide

  1. Fork → branch → code → PR
  2. Add tests and update docs
  3. Keep dependency-free
  4. Add JSDoc for new functions

Changelog Guidance

## [1.0.3] - 2025-10-03
### Added
- `preserveDigits` option
### Fixed
- Reverse mapping for Cyrillic 'е'

License

MIT License — see LICENSE