legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
28 lines • 1.01 kB
TypeScript
/**
* Version utility for CLI applications
*
* Provides dynamic version reading from package.json with ESM/CJS compatibility
* and graceful fallbacks for different runtime environments.
*/
/**
* Get the current package version dynamically from package.json
*
* This function provides multiple fallback strategies:
* 1. Try to read from the module's relative path (works when built)
* 2. Fall back to process.cwd() (works during development)
* 3. Final fallback to hardcoded version if all else fails
*
* @param basePath - Base path to resolve package.json from (CLI-specific)
* @returns The current package version string
*
* @example
* ```typescript
* // For main CLI (src/cli/index.ts)
* const version = getPackageVersion('../../package.json');
*
* // For interactive CLI (src/cli/interactive/index.ts)
* const version = getPackageVersion('../../../package.json');
* ```
*/
export declare function getPackageVersion(basePath: string): string;
//# sourceMappingURL=version.d.ts.map