@graphprotocol/graph-cli
Version:
CLI for building for and deploying to The Graph
11 lines (10 loc) • 424 B
JavaScript
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const packageJson = JSON.parse(fs
.readFileSync(
// works even when bundled/built because the path to package.json is the same
path.join(fileURLToPath(import.meta.url), '..', '..', 'package.json'))
.toString());
export const version = packageJson.version;
export const nodeVersion = (packageJson.engines?.node ?? '');