npm.io
1.0.5 • Published 2 years ago

@types/is-file-esm

Licence
MIT
Version
1.0.5
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/is-file-esm

Summary

This package contains type definitions for is-file-esm (https://github.com/davidmarkclements/is-file-esm).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-file-esm.

index.d.ts

interface Result {
    esm: boolean;
    type: "module" | "commonjs" | undefined;
    extType: "c" | "m" | "j";
    path: string;
    pkgPath: string;
}

declare const isFileEsm: {
    constants: {
        ERR_PATH_MUST_BE_STRING: string;
        ERR_PATH_MUST_BE_ABSOLUTE: string;
        ERR_PATH_MUST_EXIST: string;
        ERR_PATH_MUST_HAVE_VALID_EXT: string;
    };

    (path: string, callback: (error: Error | null, result?: Result) => void): void;
    (path: string): Promise<Result>;
    sync(path: string): Result;
};

export = isFileEsm;

Additional Details

  • Last updated: Wed, 07 Feb 2024 1344 GMT
  • Dependencies: none

Credits

These definitions were written by Leon Si.