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