import { resolve } from 'path';

function getPkgVersion() {
  const version = process.env.npm_package_version;
  if (!version) {
    try {
      return require(resolve("package.json")).version;
    } catch {
    }
  }
  return version;
}

export { getPkgVersion };
