@arvidbt/wordlib
v1.1.2
Published
A package for playing around with different dictionaries. Supports Swedish and English.
Downloads
131
Maintainers
Readme
wordlib 📚
Small package for playing around with different languages.
Installation 📦
To use the package, first install it:
npm i @arvidbt/wordlib
Then, import it as:
import { WordLib } from "@arvidbt/wordlib";
// There are dictionaries available via NPM, such as:
import { english_words } from "@arvidbt/english-words";
import { swedish_words } from "@arvidbt/swedish-words";
Instantiate the class:
// For English,
const enWords = new WordLib(english_words);
// For Swedish,
const svWords = new WordLib(swedish_words);
// For custom dictionary,
const customWords = new WordLib({ customDictionary: ["custom", "dictionary"] });
Now, you're ready to use wordlib for your own applications 🚀.
Usage 📖
For documentation and all the features WordLib brings, visit the official documentation.
The functions can be used in conjunction with eachother, such as:
const words = new WordLib(YOUR_DICTIONARY_HERE);
const randomPalindrome = words.random({
customDictionary: words.palindromes(),
});