IFClite TypeScript API
    Preparing search index...

    Function readPackageVersion

    Node-only entry for @ifc-lite/data.

    @ifc-lite/data (root) is bundled into browser apps, so anything that needs node:fs and friends lives here instead: 5.3.0 exported readPackageVersion from the root and broke every Vite production build (#5767). Reserved for the CLI and the MCP server.

    • Read version from the package manifest at pkgPath.

      A failure here is a broken install (missing/unreadable/corrupt package.json), not a normal condition. Report it on stderr and return a value that reads as unknown rather than a plausible number a bug report would then carry.

      Both consumers have already paid for the alternative. The CLI used to fall back to a hard-coded '0.4.0', which by 0.22.0 meant --version confidently reported a version the binary had not been for eighteen releases. @ifc-lite/mcp shipped VERSION = '0.1.0' as a literal and was still announcing it over the wire at 0.19.0 (#5540).

      Parameters

      • pkgPath: string

      Returns string