Add file for global constants

This commit is contained in:
Asher
2020-10-16 14:45:49 -05:00
parent 71dc5c7542
commit 4b6cbacbad
2 changed files with 14 additions and 10 deletions

13
src/node/constants.ts Normal file
View File

@ -0,0 +1,13 @@
import { logger } from "@coder/logger"
import * as path from "path"
let pkg: { version?: string; commit?: string } = {}
try {
pkg = require("../../package.json")
} catch (error) {
logger.warn(error.message)
}
export const version = pkg.version || "development"
export const commit = pkg.commit || "development"
export const rootPath = path.resolve(__dirname, "../..")