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