@types/pkginfo
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

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

/// <reference types="node" />

declare namespace PkgInfo {
    interface Options {
        dir?: string;
        include: string[];
    }

    interface FindResults {
        dir?: string;
        package: Record<string, any>;
    }

    interface PkgInfo {
        (pmodule: NodeModule, 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: NodeModule,
            dir?: string,
        ): FindResults;

        find(
            pmodule: NodeModule,
            dir?: string,
        ): Record<string, any>;
    }
}

declare const pkgInfo: PkgInfo.PkgInfo & { version: string };

export = pkgInfo;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by David Tanner.

Dependents (0)

Package Sidebar

Install

npm i @types/pkginfo

Weekly Downloads

1,574

Version

0.4.3

License

MIT

Unpacked Size

4.57 kB

Total Files

5

Last publish

Collaborators

  • types