Reference · Look words up by reading, written form, English meaning, kanji or romaji
loadCommonWordsfunction
The common words, fetched in one piece: about 26,000 rows and some 800 kB gzipped, for a page that looks up many words, all of
them common. In safe mode that is one file. Unfiltered it is that and one more, of what to add and change. Anything that is not
common is loadWords. A file that cannot be fetched rejects with a WordsLoadError.
Import it
import { loadCommonWords } from "@johnmorrisdotca/jisho/words";
Definition
function loadCommonWords(options?: WordsOptions): Promise<Words>
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | WordsOptions | The mode (safe unless you say otherwise) and the consumer's lists. |
Returns
Promise<Words>
The common words, ready for wordsOf.
Examples
import { loadCommonWords, wordsOf } from "@johnmorrisdotca/jisho/words";
console.log(wordsOf(await loadCommonWords(), "かみ").map((one) => one.written)); // ["紙", "神", ...][ '紙', '神', '髪', '加味', '上' ]What it prints (run when this page was built)