twa

twalker

List files grouped by type, asynchronously.

Showing:

Popularity

Downloads/wk

5

GitHub Stars

2

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

2.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

twalker Build Status

List files grouped by type, asynchronously. twalker is based in walk, a nodejs walk implementation.

Install

$ npm install --save twalker

Usage

var twalker = require('twalker');
var walk = twalker('/home/me', {
  Images: ['jpg', 'png', 'gif', 'icon'],
  Documents: ['doc', 'docx', 'txt', 'pdf', 'xls', 'xlsx']
});

walk.on('file', function (fileStats) {
  //do something: calculate disk usage, list file names by type, etc.
  //fileStats.metaType: 'Images', 'Documents'
});

walk.on('end', function () {
  console.log('Done.')
})

If the types parameter is null, it uses a default type definition, that can be accessed by twalker.metaTypes property.

API

twalker(baseDir, types)

baseDir

Required
Type: string

The base directory where it walks from.

types

Optional
Type: JSON

List of files extensions grouped by type.

License

MIT © Danilo Sampaio

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100