0.0.5 • Published 11 years ago

explorer v0.0.5

Weekly downloads
8
License
-
Repository
github
Last release
11 years ago

explorer Build Status Dependency Status

Explore directories in various ways.

Functions

explorer.explore (root, options)

explore returns an EventEmitter. It recursively goes through the directories under root, and while doing so, emits the following events:

  • directory (root, entryName, stat)
  • file (root, entryName, stat)
  • symlink (root, entryName, stat)
  • start
  • end
  • error (error)

The explore function starts doing it work on the next tick, so you are able to bind event listeners.

explorer.getFiles (root, options, cb)

explorer.getDirectories (root, options, cb)

explorer.countFiles (root, options, cb)

explorer.countDirectories (root, options, cb)

Options

Each function takes an optional options object as second-last argument. Currently, the following options are available:

Boolean, defaulting to false

  • ignoreNodeModules - ignore node_modules directory
  • ignoreVersionControl - ignore version control directories: .git, .svn, .hg
  • sort - entries in each directory are processed in alphabetical order

Other

  • ignoreDirectories - array with names of directories to ignore. This array is augmented with any directories following from other options.

Credits

The initial structure of this module was generated by Jumpstart, using the Jumpstart Black Coffee template.

The interface for the explore function - on which the other functions rely - was inspired by node-walk by AJ ONeal

License

explorer is released under the MIT License.
Copyright (c) 2013 Meryn Stol

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago