Skip to the content

Jisho辞書

The words of JMdict looked up by reading, written form, English meaning, a kanji in them or romaji, in small pieces fetched as needed, safe by default or unfiltered with every sense's marks, and the school grades, JLPT levels, readings, meanings and look-alike pairs of 2,999 kanji, each table an entry point of its own.

Jisho is the Japanese word 辞書 for a dictionary: this one holds Japanese words and kanji. About the name

Contents

Getting started

Getting started

Install the package, look a word up, read a grade and a level, and look a kanji up.

Install

npm install @johnmorrisdotca/jisho

Read a list

Each table is an entry point of its own, so an import loads only that table.

import {gradeOf,kanjiOfLevel} from "@johnmorrisdotca/jisho";
import {GRADES} from "@johnmorrisdotca/jisho/grades";
import {JLPT} from "@johnmorrisdotca/jisho/jlpt";
console.log(gradeOf(GRADES,"語"));
console.log(kanjiOfLevel(JLPT,"N5").length);
2
79

Look a kanji up

readKanji turns the stored table into plain rows. Build a Map once and keep it, if a page looks up more than a few.

import {readKanji} from "@johnmorrisdotca/jisho";
import {KANJI} from "@johnmorrisdotca/jisho/kanji";
const byKanji=new Map(readKanji(KANJI).map((one)=>[one.kanji,one]));
console.log(byKanji.get("山")?.meanings);
[ 'mountain' ]

Look a word up

Words are fetched in small pieces, only the ones a lookup needs, so loadWords waits and wordsOf does not.

import {loadWords,wordsOf} from "@johnmorrisdotca/jisho/words";
const words=await loadWords("かみ");
console.log(wordsOf(words,"かみ")[0]?.meaning);
paper

Look words up says how to look a word up by its reading or its written form, how to choose safe or unfiltered words and pass your own lists, and how to keep the dictionary out of a server's bundle. The words can also be found by their English meaning, by a kanji in them and in romaji; how common a word is, looking up a conjugated word, reading a text and odd input and pieces that will not load have a guide each. Find kanji has the recipes, how the look-alike pairs are measured says what a score means, and where the data comes from says what you must credit.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jisho 2.11.0.