UNPKG

@types/pkginfo

Version:
58 lines (45 loc) 1.63 kB
# Installation > `npm install --save @types/pkginfo` # Summary This package contains type definitions for pkginfo (https://github.com/indexzero/node-pkginfo). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pkginfo. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pkginfo/index.d.ts) ````ts /// <reference types="node" /> declare namespace PkgInfo { interface Options { dir?: string; include: string[]; } interface FindResults { dir?: string; package: Record<string, any>; } interface PkgInfo { (pmodule: NodeJS.Module, options?: Options | string[] | string, ...properties: string[]): PkgInfo; // // ### function find (dir) // #### @pmodule {Module} Parent module to read from. // #### @dir {string} **Optional** Directory to start search from. // Searches up the directory tree from `dir` until it finds a directory // which contains a `package.json` file. // read( pmodule: NodeJS.Module, dir?: string, ): FindResults; find( pmodule: NodeJS.Module, dir?: string, ): Record<string, any>; } } declare const pkgInfo: PkgInfo.PkgInfo & { version: string }; export = pkgInfo; ```` ### Additional Details * Last updated: Fri, 14 Nov 2025 18:02:08 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) # Credits These definitions were written by [David Tanner](https://github.com/DavidTanner).