@tapjs/run
Version:
Command-line interface for the node-tap runner
15 lines • 461 B
JavaScript
import { readFileSync } from 'fs';
import { resolve } from 'path';
/**
* get the versions of a package that is installed at top level
*/
export const getInstalledVersion = (name, config) => {
const pj = resolve(config.projectRoot, '.tap', 'plugins', 'node_modules', name, 'package.json');
try {
return JSON.parse(readFileSync(pj, 'utf8')).version;
}
catch {
return '';
}
};
//# sourceMappingURL=get-installed-version.js.map