datapilot-cli
Version:
Enterprise-grade streaming multi-format data analysis with comprehensive statistical insights and intelligent relationship detection - supports CSV, JSON, Excel, TSV, Parquet - memory-efficient, cross-platform
32 lines • 1.09 kB
JavaScript
;
/**
* Version utility - Reads version from package.json
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDataPilotVersion = getDataPilotVersion;
const fs_1 = require("fs");
const path_1 = require("path");
let cachedVersion = null;
/**
* Get the current DataPilot version from package.json
*/
function getDataPilotVersion() {
if (cachedVersion) {
return cachedVersion;
}
try {
// Try to read package.json from the project root
// This works whether we're running from dist/ or src/
const packageJsonPath = (0, path_1.join)(__dirname, '..', '..', 'package.json');
const packageJsonContent = (0, fs_1.readFileSync)(packageJsonPath, 'utf8');
const packageJson = JSON.parse(packageJsonContent);
cachedVersion = packageJson.version;
return cachedVersion;
}
catch (error) {
// Fallback in case package.json can't be read
// This should only happen in unusual deployment scenarios
return '1.7.0';
}
}
//# sourceMappingURL=version.js.map