UNPKG

@jsbits/get-package-version

Version:

Get the version of the package.json file found in the given directory or in one of its parents.

15 lines 671 B
/** * Returns the version of the first package.json file found in the given * directory or in one of its parents. * * - If you don't provide a path, the search starts in the current one. * - The provided path can be relative to the current working directory. * - Packages with a missing or empty `version` property are ignored. * * @param {string} [pkgPath=.] Initial directory to search, defaults to `process.cwd()`. * @returns {string} The package version, or an empty string if it could not be found. * @since 1.0.0 */ declare const getPackageVersion: (pkgPath?: string | undefined) => string; export = getPackageVersion; //# sourceMappingURL=index.d.ts.map