0.0.8 • Published 6 months ago

koalacodes v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Koala Codes

Random Codes Generator

THIS LIBRARY IS IN EARLY STAGES - EXPECT BEAKING CHANGES


Description:

This library generates random codes alternating consonants and vowels.


Installation:

npm install koalacodes

Usage:

const KoalaCodes = require("koalacodes");

const KC = new KoalaCodes();

console.log(KC.generateCode(-1)); // Defaults to 8 - YIFEJUMA
console.log(KC.generateCode(0)); // Defaults to 8 - HOVUDETO
console.log(KC.generateCode()); // Defaults to 8 - MUWAXIDE
console.log(KC.generateCode(1)); // H
console.log(KC.generateCode(4)); // SANA
console.log(KC.generateCode(7)); // HOKUDET
console.log(KC.generateCode(12)); // NOWUKUZEDEWI

Set a default length by passing an object with defaultLength on it. (More options to come in future versions)

const KC = new KoalaCodes({ defaultLength: 6 });

Using import syntax:

import KoalaCodes from "koalacodes";

User defined arrays of vowels and consonants

const KC = new KoalaCodes({
	defaultLength: 7,
	vowels: ["а", "е", "ё", "и", "о", "у", "ы", "э", "ю", "я"],
	consonants: ["б", "в", "г", "д", "ж", "з", "к", "л", "м", "н", "п", "р", "с", "т", "ф", "х", "ц", "ч", "ш", "щ"]
});

console.log(KC.generateCode(4)); // хажя
console.log(KC.generateCode()); // рулакыч

Notes

At this stage the library will always generate a code that alternates consonants with vowels starting always with a consonant. This is just a way to make the codes somewhat readables.


TODO and Future Features

  • Hability to control UpperCase and LowerCase letters

Feedback

All feedback is welcome just write an issue.


License MIT

0.0.8

6 months ago

0.0.7

9 months ago

0.0.6

1 year ago

0.0.5

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago