Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
walk through directory trees and apply an action to every file
JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.npmignore
LICENSE.mkd
README.mkd
dive.js
package.json

README.mkd

dive is a tiny module for node that is able to recursively walk („dive“) a directory tree. dive is the asynchronous version of diveSync.

dive(directory[, options], action[, complete]);
  • directory is the pathname of a readable directory.
  • options [optional] is an object that defines some of the properties.

    The default options are as follows:

    {
      recursive: true,    // - If set to false, this will ignore subdirectories.
      all: false,         // - If set to true, this will show "dot files" and
                          //   files in "dot directories", e.g. ".gitignore" or
                          //  ".git/HEAD".
      directories: false  // - If set to true, this will call `action` on
                          //   directories, too.
    }
  • action is passed two arguments (err, file) where err is an error or null and file is the pathname of a file.
  • complete [optional] may define a second callback, that is called, when all files have been processed. It takes no arguments.

Usage

var dive = require('dive');

dive(process.cwd(), { all: true }, function(err, file) {
  if (err) throw err;
  console.log(file);
}, function() {
  console.log('complete');
});

Installation

$ npm install -g dive

Bugs and Issues

If you encounter any bugs or issues, feel free to open an issue at github.

License

This package is licensed under the MIT license.

Something went wrong with that request. Please try again.