@pedrocid/music-mcp
Version:
MCP server for controlling Apple Music on macOS (v1.0.5)
24 lines (23 loc) • 760 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVersion = getVersion;
const fs_1 = require("fs");
const path_1 = require("path");
let cachedVersion;
function getVersion() {
if (cachedVersion) {
return cachedVersion;
}
try {
// Find package.json relative to this file (CommonJS)
const packageJsonPath = (0, path_1.join)(__dirname, '../../package.json');
const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, 'utf-8'));
cachedVersion = packageJson.version || '1.0.0';
return cachedVersion;
}
catch (error) {
// Fallback version if package.json can't be read
cachedVersion = '1.0.0';
return cachedVersion;
}
}