readdir-recursive-pattern
Recursively list all files in a directory and its subdirectories that match a RegEx pattern.
Last updated 2 years ago by vadim-ivlev .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install readdir-recursive-pattern 
SYNC missed versions from official npm registry.

Build Status

readdir-recursive-pattern

Recursively list all files in a directory and its subdirectories that match a RegEx pattern.

Install

npm install readdir-recursive-pattern

Example

    var listFiles = require('readdir-recursive-pattern');

    listFiles('testdir') === [
        'testdir/a.htm',
        'testdir/b.html',
        'testdir/c.html',
        'testdir/sub0/1.gif',
        'testdir/sub0/2.gif',
        'testdir/sub0/3.jpg',
        'testdir/sub0/sub1/1.htm',
        'testdir/sub0/sub1/2.htm' 
    ]

API

    listFiles(root [, regex])

root is the directory you wish to scan. regex is an optional parameter for the files to filter. For example to list all html files:

    listFiles(root , /\.html$/ )

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
  • ava 1.0.0-beta.5.1
Dependents (1)

Copyright 2014 - 2017 © taobao.org |