mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
9 lines
511 B
TypeScript
9 lines
511 B
TypeScript
import ReadPkgUp = require('read-pkg-up');
|
|
|
|
ReadPkgUp().then(pkg => pkg.pkg.name); // $ExpectType Promise<string>
|
|
ReadPkgUp({cwd: '.', normalize: true}).then(pkg => pkg.pkg.name); // $ExpectType Promise<string>
|
|
ReadPkgUp({cwd: '.', normalize: false}).then(pkg => pkg.pkg['name']); // $ExpectType Promise<any>
|
|
ReadPkgUp.sync().pkg.name; // $ExpectType string
|
|
ReadPkgUp.sync({cwd: '.', normalize: true}).pkg.name; // $ExpectType string
|
|
ReadPkgUp.sync({cwd: '.', normalize: false}).pkg['name']; // $ExpectType any
|