How to use js-mdict - 2 common examples

To help you get started, we’ve selected a few js-mdict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github terasum / medict / src / background / bgworker / bg.worker.js View on Github external
function loadMDD (mddpath) {
  // TODO change mdd file path
  if (!fs.existsSync(mddpath) || !mddpath.endsWith('.mdd')) {
    console.log('bgworker mdd file path not exist return')
    return
  }
  // const mddpath = path.join(__static, 'dicts/oale8.mdd')
  console.log(mddpath)
  console.log(JSMdict)
  MDDDict.jsmdict = new JSMdict(mddpath)
  MDDDict.loaded = true
  console.log('mdd loaded...')
}
github terasum / medict / src / renderer / store / modules / medict.js View on Github external
loadDict ({commit, state, getters}) {
    if (!state.dict.inited) {
      console.log('loading...')
      const cssPath = path.join(__static, './style/CollinsEC.css')
      const styleContent = fs.readFileSync(cssPath, 'utf8')
      commit(INIT_DICT_CSS, styleContent, cssPath)
      return new Mdict(state.dict.path).build()
    } else {
      console.log('dict loaded...')
    }
  },
  search ({commit, state, getters}, word) {

js-mdict

mdict (*.mdx, *.mdd) file reader

MIT
Latest version published 26 days ago

Package Health Score

73 / 100
Full package analysis

Popular js-mdict functions