2.1.2 • Published 26 days ago

wl.js v2.1.2

Weekly downloads
-
License
0BSD
Repository
github
Last release
26 days ago

Table of Contents

Installation

With node package manager:

npm i wl.js@latest # or your preferred package manager

With a script tag:

<script src="https://unpkg.com/wl.js"></script>

With pain (self-hosting):

  1. Download the source code from wrong-lang/wl.js
  2. Build the source code with the following command:
npm run build # or your preferred package manager
  1. Include the built file in your HTML:
<script src="index.min.js"></script>
  1. Have fun!

Language Swap

// File: ./examples/languageSwap.js
import { WrongLang } from "wl.js";
const wrongLang = new WrongLang();

const output = wrongLang.languageSwap({
  layout: {
    primary: "Kedmanee", // Default: Kedmanee
    secondary: "Qwerty", // Default: Qwerty
  },
  text: "l;ylfu8iy[",
});

console.log(output); // "สวัสดีครับ"

Unshift

// File: ./examples/unshift.js
import { WrongLang } from "wl.js";
const wrongLang = new WrongLang();

let output = wrongLang.unshift({
  layout: "Kedmanee",
  text: "ศซํศโ๊๕ณํฐ(ุ็๙ฒ",
});

console.log(output); // "สวัสดีครับผู้ชม"

output = wrongLang.unshift({
  layout: "Qwerty",
  text: "hELLO EVERYNYAN. hOW ARE YOU? fINE, SANKYUU.",
  realShift: false, // Default: true
});

console.log(output); // "Hello everynyan. How are you? Fine, sankyuu."

Custom Layouts

// File: ./examples/customLayout.js
import { WrongLang } from "wl.js";
const wrongLang = new WrongLang();

wrongLang.addCustomLayout({
  customLayout: {
    name: "Morse",
    keys: {
      normal:
        ".- |-... |-.-. |-.. |. |..-. |--. |.... |.. |.--- |-.- |.-.. |-- |-. |--- |.--. |--.- |.-. |... |- |..- |...- |.-- |-..- |-.-- |--.. |/ ".split(
          "|",
        ),
      shift:
        ".- |-... |-.-. |-.. |. |..-. |--. |.... |.. |.--- |-.- |.-.. |-- |-. |--- |.--. |--.- |.-. |... |- |.-- |...- |.-- |-..- |-.-- |--.. |/ ".split(
          "|",
        ),
    },
  },
  defineKeyLength: 54,
});

wrongLang.addCustomLayout({
  customLayout: {
    name: "Alphabet",
    keys: {
      normal: "abcdefghijklmnopqrstuvwxyz ".split(""),
      shift: "abcdefghijklmnopqrstuvwxyz ".toUpperCase().split(""),
    },
  },
  defineKeyLength: 54,
});

const output = wrongLang.languageSwap({
  layout: {
    primary: "Alphabet",
    secondary: "Morse",
  },
  text: "Hello World",
});

console.log(output); // ".... . -.-- -.-- --- / .-- --- .-. -.-- -.."
2.1.2

26 days ago

2.1.1

26 days ago

2.1.0

26 days ago

2.0.2

28 days ago

2.0.1

28 days ago

2.0.0

28 days ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.0

8 months ago

1.2.1

8 months ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago