1 | # Installation
|
2 | > `npm install --save @types/pkginfo`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for pkginfo (https://github.com/indexzero/node-pkginfo).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pkginfo.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pkginfo/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for pkginfo 0.4
|
12 | // Project: https://github.com/indexzero/node-pkginfo
|
13 | // Definitions by: David Tanner <https://github.com/DavidTanner>
|
14 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
15 |
|
16 | /// <reference types="node" />
|
17 |
|
18 | declare namespace PkgInfo {
|
19 | interface Options {
|
20 | dir?: string;
|
21 | include: string[];
|
22 | }
|
23 |
|
24 | interface FindResults {
|
25 | dir?: string;
|
26 | package: Record<string, any>;
|
27 | }
|
28 |
|
29 | interface PkgInfo {
|
30 | (pmodule: NodeModule, options?: Options | string[] | string, ...properties: string[]): PkgInfo;
|
31 |
|
32 | //
|
33 | // ### function find (dir)
|
34 | // #### @pmodule {Module} Parent module to read from.
|
35 | // #### @dir {string} **Optional** Directory to start search from.
|
36 | // Searches up the directory tree from `dir` until it finds a directory
|
37 | // which contains a `package.json` file.
|
38 | //
|
39 | read(
|
40 | pmodule: NodeModule,
|
41 | dir?: string
|
42 | ): FindResults;
|
43 |
|
44 | find(
|
45 | pmodule: NodeModule,
|
46 | dir?: string
|
47 | ): Record<string, any>;
|
48 | }
|
49 | }
|
50 |
|
51 | declare const pkgInfo: PkgInfo.PkgInfo & { version: string; };
|
52 |
|
53 | export = pkgInfo;
|
54 |
|
55 | ````
|
56 |
|
57 | ### Additional Details
|
58 | * Last updated: Tue, 26 Oct 2021 21:31:22 GMT
|
59 | * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
60 | * Global values: none
|
61 |
|
62 | # Credits
|
63 | These definitions were written by [David Tanner](https://github.com/DavidTanner).
|
64 |
|
\ | No newline at end of file |