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 13:06:44 GMT
- Dependencies: none
Credits
These definitions were written by Leon Si.