MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getModuleVersion

Method getModuleVersion

packages/cli/src/CLIHelper.ts:262–270  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

260 }
261
262 static getModuleVersion(name: string): string {
263 try {
264 const path = `${this.resolveModulePath(name)}/package.json`;
265 const pkg = fs.readJSONSync(path);
266 return colors.green(pkg.version);
267 } catch {
268 return '';
269 }
270 }
271
272 /**
273 * Resolve path to a module.

Callers 4

dumpDependenciesMethod · 0.80
handlerMethod · 0.80
CLIHelper.test.tsFile · 0.80

Calls 2

resolveModulePathMethod · 0.95
readJSONSyncMethod · 0.80

Tested by

no test coverage detected