Archived
1
0
Fork 0
This repository has been archived on 2024-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
emacs/dictionaries/he/index.js

28 lines
507 B
JavaScript
Raw Normal View History

const fs = require('fs')
const path = require('path')
module.exports = load
function load(callback) {
let result = {}
let pos = -1
let exception
one('aff')
one('dic')
function one(name) {
fs.readFile(path.join(__dirname, 'index.' + name), (error, doc) => {
pos++
exception = exception || error
result[name] = doc
if (pos) {
callback(exception, exception ? undefined : result)
exception = undefined
result = undefined
}
})
}
}