UNPKG

358 BPlain TextView Raw
1import findUp from "find-up";
2import fs from "fs";
3
4const packagePath: string | undefined = findUp.sync("package.json");
5
6if (packagePath === undefined) {
7 throw new Error("Cannot find `package.json`");
8}
9
10const pkg: any = JSON.parse(fs.readFileSync(packagePath, {encoding: "UTF-8"}));
11
12/**
13 * `c88` version.
14 */
15export const VERSION: string = pkg.version;