https://github.com/danielstjules/filepaths
Get paths to all files in dirs/subdirs in node
https://github.com/danielstjules/filepaths
Last synced: 9 months ago
JSON representation
Get paths to all files in dirs/subdirs in node
- Host: GitHub
- URL: https://github.com/danielstjules/filepaths
- Owner: danielstjules
- License: mit
- Created: 2014-09-21T03:09:17.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T00:51:56.000Z (over 9 years ago)
- Last Synced: 2025-01-31T10:22:27.862Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
filepaths
==============
Get paths to all files in dirs/subdirs in node
[](https://travis-ci.org/danielstjules/filepaths)
#### getSync(paths, [opts])
Recurses through the supplied paths, returning an array of file paths found
in each. Paths may be a string, or an array of strings. The paths may be
strings pointing to files or directories. Accepts an options object with
the following keys: ignore and ext. opts.ignore takes either a single
string pattern or array of patterns to ignore. opts.ext accepts either
a string, or array of strings corresponding to filename extensions to
retrieve.
``` javascript
var filepaths = require('filepaths');
filepaths.getSync('/dir');
filePaths.getSync('/lib', {ext: '.js'});
filePaths.getSync('/project', {ignore: 'node_modules'});
filePaths.getSync('/project', {ignore: 'test|spec'});
filepaths.getSync(['/dir1', '/dir2'], {
ext: ['.js', '.jsx'],
ignore: ['node_modules']
});
```