iterate-files

0.1.1 • Public • Published

iterateFiles

Iterate all the files

Examples

Basic usage:

var iterateFiles = require("iterate-files"),
    path = require("path")

// Load all javascript files in the test folder or any of their sub folders
iterateFiles(path.join(process.cwd(), "./test"), function (fileName) {
    // run code for each recursively found js file
}, function (err) {
    // run code when all files have been found recursively
}, /.js$/)

Documentation

iterateFiles(uri, fileCallback, finishCallback, regexp)

recursively call the fileCallback for every file in the folder. Calls the finishCallback if all files have been handled or if an err occurs.

Optionally pass in a regexp to match the fileName by. If the regexp fails then the fileCallback will not be called for that file

MIT Licenced

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    826
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    826
  • 0.1.0
    1

Package Sidebar

Install

npm i iterate-files

Weekly Downloads

372

Version

0.1.1

License

none

Last publish

Collaborators

  • raynos