0.2.1 • Published 3 years ago

fs-synchronizer v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

fs-synchronizer

NPM version build status Test coverage npm download

Recursively find files in folder and extract file informations.

Installation

$ npm i fs-synchronizer

Usage

import { FileSynchronizer } from 'fs-synchronizer';
const sync = new FileSynchronizer({
  root: 'test-utils',
  maxDepth: 2,
  patterns: [{ type: 'include', pattern: 'a*' }],
});

sync.on('file', (fileInfo) => {
  console.log(`Found file: ${fileInfo.filename}`);
});
sync.on('excluded-file', (fileInfo) => {
  console.log(`Excluded file: ${fileInfo.filename}`);
});
sync.on('end', () => {
  console.log('Finished walking');
});
await sync.walk();

License

MIT

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago