0.0.1 • Published 9 months ago
mdx-dict-parser v0.0.1
MDX-DICT-PARSER
This is a package based on napi-rs and mdict-parser, which provides the node-binding to read all the words and their definitions from mdict(.mdx) file.
Usage
This package is ESM only.
First, install the package
npm i mdx-dict-parser
You can write such code in typescript.
import { parseMdict, DictRecord } from "mdx-dict-parser";
const filePath = "./the/path/to/your/dictionary.mdx";
const data: DictRecord[] = parseMdict(filePath);
const thirdRecord = data[3];
console.log(thirdRecord); // Print the third record.
Roadmap
This project is planned to implement these following functions soon.
- mdict 1.0 and 3.0 support.
- Read details for mdict file.
- MDD parser support.
LICENSE
MIT@但为君故.