1.0.5 • Published 6 years ago

iterable-readfiles v1.0.5

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

iterable-readfiles

Node.js module for iterate through all files in a directory.

Install

npm install iterable-readfiles --save

How to use

import {readfiles, IgnoreType, IgnoreFunction} from 'iterable-readfiles';

// Customize your ignore rule set
let customize: IgnoreFunction = (path: string): boolean => {
    // ignore file:/data1/www/readfiles/package.json
    let shallIgnore = false;
    if (path.indexOf(LibPath.normalize('/data1/www/readfiles/package.json')) !== -1) {
        shallIgnore = true;
    }
    return shallIgnore;
};
// ignore dirname:`node_modules` , regular expression:`*.js`, IgnoreFunction: customize()
let ignores:  Array<IgnoreType> = ['node_modules', '*.js', customize];

readfiles('some/path', ignores)
    .then(files => console.log(files))
    .catch(err => console.log(err));
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago