1.2.0 • Published 5 years ago

get-files-in v1.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Get files in

A Node.js script that synchronously returns a list of file paths of specified types from a directory or directories.

Install

npm install -D get-files-in

Usage

getFilesIn(folderPath, matchFiletypes = [], checkSubDirectories = false)
require()
getFilesIn(path.resolve(__dirname, source.styles), [
    "scss",
    "sass",
    "less",
]
// [
//  '/Users/hotstuff/project/src/styles/main.scss',
//  '/Users/hotstuff/project/src/styles/hello.sass',
// ]
require()
getFilesIn(path.resolve(__dirname, source.styles), [
    "scss",
    "sass",
    "less",
], true
// [
//  '/Users/hotstuff/project/src/styles/main.scss',
//  '/Users/hotstuff/project/src/styles/hello.sass',
//  '/Users/hotstuff/project/src/styles/subfolders-allowed/index.sass',
// ]