UNPKG

pangu

Version:

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).

20 lines (19 loc) 482 B
import { readFile } from "node:fs/promises"; import { readFileSync } from "node:fs"; import { Pangu } from "../shared/index.js"; class NodePangu extends Pangu { async spacingFile(path) { const data = await readFile(path, "utf8"); return this.spacingText(data); } spacingFileSync(path) { return this.spacingText(readFileSync(path, "utf8")); } } const pangu = new NodePangu(); export { NodePangu, pangu as default, pangu }; //# sourceMappingURL=index.js.map