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 🙏

© 2024 – Pkg Stats / Ryan Hefner

wisely

v0.4.2

Published

Obfuscating text or phrases with random uncommon characters to avoid banning.

Downloads

16

Readme

Wisely

Obfuscating text or phrases with random uncommon characters to avoid banning. Everyone is free to speak as long as they do so wisely.

MIT license npm version

Prerequisites

  • Node.js 18 or higher
  • npm 9 or higher

Install

npm install wisely

Usage

Obscures the entire text

import wisely from 'wisely';

const text = 'Palestine will be free! Freedom is the right of ALL nations!';

console.log(wisely({ text }));
// P@l3$t|n3 w!ll 83 fr33! Fr33d0m |$ t#3 r!6#t 0f @LL n4t|0n5!

Obscures certain phrases

console.log(wisely({ text, phrases: ['palestine', 'free'] }));
// P4l35t1n3 will be fr33! Freedom is the right of ALL nations!

Obscures with custom character set

const customCharSet = {
  a: ['@', '4'],
  e: ['3'],
  i: ['1', '!'],
  o: ['0'],
  s: ['5', '$'],
  t: ['7'],
};

console.log(wisely({ text, charSets: [customCharSet] }));
// P@l3$7!n3 w1ll b3 fr33! Fr33d0m 1$ 7h3 r1gh7 0f 4LL n@710n$!

See options.charsets for more details.

API

wisely(options)

Returns a string with the obsfucated text.

options

Type: object

text
  • Type: string
  • Required: true

The text to be obscured.

phrases
  • Type: string[]
  • Required: false

The specific phrases to be obscured. If not specified or empty, the entire text will be obscured.

Each phrase must be less than or equal to 30 characters and only contain the following characters:

  • Alphabets (a-z, A-Z)
  • Numbers (0-9)
  • Spaces ( )
  • Hyphens (-)
  • Underscores (_)
  • Apostrophes (')
  • Forward slashes (/)
caseSensitive
  • Type: boolean
  • Default: false

Whether to obscure in a case-sensitive manner.

charSets
  • Type: (string | object)[]
  • Default: ['latin']

The character set that will be used for obfuscation. Put the name of the built-in character sets or a custom character set objects.

The valid custom character set must be an object that contains key-value pairs where:

  • The key is the character to be replaced. It must be a single alphabet character (a-z, A-Z).
  • The value is an array of characters that will be used to replace the key. It must be an array of any single characters other than control characters and private use area block.

See the example below.

const customCharSet = {
  a: ['@', '4'],
  e: ['3'],
  i: ['1', '!'],
  o: ['0'],
  s: ['5', '$'],
  t: ['7'],
};

isCharSetValid(charSet)

Returns a boolean whether the character set is valid.

charSet

Type: object

The character set that will be checked.

mergeCharSets(...charSets)

Returns a merged character set object.

charSets

Type: string | object

The character set that will be merged. Put the name of the built-in character sets or a custom character set objects.

Character Sets

Below is the built-in character sets available. See the details of each character set in the charsets directory.

| charSet Name | Block Name | Block Range | | --- | --- | --- | | latin | Basic Latin | \u0000 - \u007f | | latin-1 | Latin-1 Supplement | \u0080 - \u00ff | | latin-ext-a | Latin Extended-A | \u0100 - \u017f | | latin-ext-b | Latin Extended-B | \u0180 - \u024f |

Support This Project

Give a ⭐️ if this project helped you!

Also please consider supporting this project by becoming a sponsor. Your donation will help us to maintain and develop this project and provide you with better support.