Files
NapCatQQ/.pnpm-store/v3/files/47/e1446bfe0780386708a7da839460bd1c3e9635e5985f38b53b12abe084797c499bc8a62765d9d6b711bce1b534a5af48faf54a317ddac03b403744a381911e
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

60 lines
1.4 KiB
Plaintext

import * as typeFest from 'type-fest';
import * as normalize from 'normalize-package-data';
export interface Options {
/**
Current working directory.
@default process.cwd()
*/
readonly cwd?: string;
/**
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
@default true
*/
readonly normalize?: boolean;
}
export interface NormalizeOptions extends Options {
readonly normalize?: true;
}
export type NormalizedPackageJson = PackageJson & normalize.Package;
export type PackageJson = typeFest.PackageJson;
/**
@returns The parsed JSON.
@example
```
import {readPackageAsync} from 'read-pkg';
console.log(await readPackageAsync());
//=> {name: 'read-pkg', …}
console.log(await readPackageAsync({cwd: 'some-other-directory'});
//=> {name: 'unicorn', …}
```
*/
export function readPackageAsync(options?: NormalizeOptions): Promise<NormalizedPackageJson>;
export function readPackageAsync(options: Options): Promise<PackageJson>;
/**
@returns The parsed JSON.
@example
```
import {readPackageSync} from 'read-pkg';
console.log(readPackageSync());
//=> {name: 'read-pkg', …}
console.log(readPackageSync({cwd: 'some-other-directory'});
//=> {name: 'unicorn', …}
```
*/
export function readPackageSync(options?: NormalizeOptions): NormalizedPackageJson;
export function readPackageSync(options: Options): PackageJson;