UNPKG

@ronniepettersson/homebridge-dummy

Version:

Create Homebridge accessories to help with automation and control — scheduling, delays, sensors, commands, webhooks, and more

18 lines 580 B
import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function loadPackageJson() { const __dirname = path.dirname(fileURLToPath(import.meta.url)); const packageJSONPath = path.join(__dirname, '../../package.json'); return JSON.parse(fs.readFileSync(packageJSONPath, { encoding: 'utf8' })); } export default function getVersion() { try { return loadPackageJson().version; } catch (error) { return '0.0.0'; } } //# sourceMappingURL=version.js.map