@arvidbt/wordlib

1.1.2 • Public • Published

wordlib 📚

Test GitHub GitHub package.json version (subfolder of monorepo) GitHub code size in bytes

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(),
});

Package Sidebar

Install

npm i @arvidbt/wordlib

Weekly Downloads

8

Version

1.1.2

License

MIT

Unpacked Size

357 kB

Total Files

31

Last publish

Collaborators

  • arvidbt