1.1.1 • Published 4 years ago

find-file-extension v1.1.1

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

find-file-extension

npm version Buid Status

The npm package find-file-extension searches for a specified file type in a given directory or directories and returns an array of file paths. Unlike Node.js's fs.readdir(), which only reads through the directory without a rescursive option, this program will recursively find all file paths with the given extension within a subdirectory or subdirectories.

Installation

npm i find-file-extension

Usage

const { searchFiles } = require("find-file-extension");

// Single directory usage
const filePaths = searchFiles("js", "./src");

// Multiple directory usage
const filePaths = searchFiles("js", "./src", "./test");
const filePaths = searchFiles("jsx", "./src/components", "./src/store", "./src/app");