2.0.0 • Published 5 years ago

@seangenabe/tangonoya-common v2.0.0

Weekly downloads
26
License
MIT
Repository
gitlab
Last release
5 years ago

Tangonoya

Data source for Japanese words and kanji.

Usage

JMdict updater

import { updateDatabase } from "./jmdict"

updateDatabase(db: PouchDB.Database, opts = {}): Promise

Updates a PouchDB database with the latest entries from JMdict. pouchdb-upsert is required.

  • db - A PouchDB database.
  • opts.gunzipUrl - Passed to gunzip-then-rsync
  • opts.rsyncSource - Passed to gunzip-then-rsync
  • opts.idPrefix - Prefixed to document IDs. Default: jmdict/

WaniKani updater

import { updateDatabase } from "./wanikani"

updateDatabase(db: PouchDB.Database, opts): Promise

Updates a PouchDB database with 'subjects' from the WaniKani API. pouchdb-upsert is required.

  • db - A PouchDB database.
  • opts.apiKey - A WaniKani v2 API key.
  • opts.idPrefix - Prefixed to document IDs. Default: wanikani/

License

This source code itself is licensed with MIT. However, source files may be licensed under different terms: