mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
432 B
TypeScript
15 lines
432 B
TypeScript
/// <reference types="node" />
|
|
import whichpm = require("which-pm");
|
|
|
|
whichpm(process.cwd())
|
|
.then(pm => {
|
|
pm; // $ExpectType PMInfo | null
|
|
if (pm !== null && pm !== undefined) {
|
|
pm.name; // $ExpectType string
|
|
pm.version; // $ExpectType string | undefined
|
|
}
|
|
})
|
|
.catch(err => console.error(err));
|
|
|
|
const _wpm = whichpm(process.cwd()); // $ExpectType Promise<PMInfo | null>
|