0.0.2 • Published 3 years ago

le37 v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

l3e7

NPM version

leetspeak utility

install

pnpm i l3e7

Usage

import * as le37 from 'le37'

const str = le37.conver('Hello World')
// H3110 W0r1d
console.log(str)

Option

ratio

What percentage of characters will be converted, default value is 1

rule

Rules for character conversion, there are two Built-in presets for you, default is simple

  • simple
originoutput
A4
B8
E3
G6
I1
KX
L1
O0
S5
T7
Yj
Z2
  • complex
originoutput
A4
B8
C[
D\|)
E3
F\|=
G6
H#
I1
J_\|
KX
L1
M\|v\|
N^/
O0
P\|*
Q(_,)
R\|`
S5
T7
U(_)
V\/
W\/\/
X><
Yj
Z2

You can use it like this

le37('hello', 'simple')

or you can past you custom directory

const directory = {
  o: '0'
}
const str = le37.conver('hello', {
  rule: 'custom',
  directory,
})

// hell0
console.log(str)

if you use custom, it will be case-sensitive:

// hell0 HELLO
console.log(le37.conver('hello HELLO', {
  rule: 'custom',
  directory,
}))

As the appeal code shows, upper case O will not be converted

License

MIT License © 2022 kkopite