file-resolve
v1.0.1
Published
Resolve file by path and extensions
Downloads
11
Readme
file-resolve
Resolve file by path and extensions
Install
yarn add file-resolve
# or
npm i file-resolve
Usage
import fileResolve from "file-resolve";
fileResolve("file/path"); // file/path/index.ts
fileResolve.extensions([".css"])("file/path"); // file/path/index.css
API
interface fileResolve {
(p: string): string;
extensions(extensions: string[]): any; // default [".js", ".jsx", ".ts", ".tsx"]
}