3.0.0 • Published 5 months ago

japanese-data-module v3.0.0

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

How to use?

/** Import wanted module */
import kanjisFromJlpt5 from 'japanese-data-module/full/kanji-jlpt5.json' assert {type: 'json'};

/** Import helpers */
import {KanjiRow, RI, objectifyKanjiRow} from 'japanese-data-module/full';

const _10thKanji = kanjisFromJlpt5[9];

// By default data is in "row" format (use RI to access indexes)
console.log(_10thKanji[RI.VALUE]); // "間"
console.log(_10thKanji[RI.MEANING]); // "interval, space"

// You can also objectify rows
const kanji = objectifyKanjiRow(_10thKanji);
console.log(kanji.meaning); // "interval, space"

There are 3 set for now: full, tagless, tagless-noroman (ranking from heavy to less heavy files but also less descriptive.)

When you import a set you have to use the helpers from the same module, for instance:

// notice the use of the set "tagless" here
import data from 'japanese-data-module/tagless/kanji-jlpt1.json' assert {type: 'json'};

// helpers need to be imported from "tagless" to work properly with above data.
import {Kanji} from 'japanese-data-module/tagless';
3.0.0

5 months ago

2.0.0-pre.1

12 months ago

2.3.0

11 months ago

2.2.1

12 months ago

2.2.0

12 months ago

2.3.1

11 months ago

2.2.2

12 months ago

2.1.0

12 months ago

2.0.1

12 months ago

2.0.0

12 months ago

1.1.0

2 years ago

1.0.0

2 years ago