UNPKG

@kadena/kadena-cli

Version:

Kadena CLI tool to interact with the Kadena blockchain (manage keys, transactions, etc.)

12 lines 524 B
import fs from 'node:fs/promises'; import { safeJsonParse } from './globalHelpers.js'; export const getVersion = async () => { var _a; const filepath = new URL('../../package.json', import.meta.url); const file = await fs.readFile(filepath, 'utf8').catch(() => null); if (file === null) return 'unknown'; const json = safeJsonParse(file); return (_a = json === null || json === void 0 ? void 0 : json.version) !== null && _a !== void 0 ? _a : 'unknown'; }; //# sourceMappingURL=version.js.map