Popularity
0.6
Stable
Activity
0.0
Stable
17
1
2

Description

Searches for files by content

Code Quality Rank: L5
Monthly Downloads: 0
Programming language: TypeScript
License: Apache License 2.0
Tags: Search     Filesystem     Node.Js     Promise     Path     Files     File     Finder     Find     Fs     Directory     Folder     Dir     Contains     Recursive     Contents     Sniffer     Walk     walker     grep     filesniffer    
Latest version: v0.0.1

FileSniffer alternatives and similar modules

Based on the "Filesystem" category.
Alternatively, view FileSniffer alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of FileSniffer or a related project?

Add another 'Filesystem' Module

README

FileSniffer

NPM downloads Build Status Coverage Status github-issues

Find files by matching contents

Installation

npm install --save filesniffer

Usage

// Searches for `someString` in `/tmp/test.txt`, returning all matches as an array:
const matches = await FileSniffer.create()
  .path('/tmp/test.txt')
  .collect(asArray())
  .find('someString');

  console.log(matches); // array of matching lines
// Use events for searching large files: 
const sniffer = await FileSniffer.create();

// register event handlers
sniffer.on('match', (filename, line) => {
  console.log(`Matching line ${line} found in ${filename}`);
});

sniffer.on('end', (filenames) => {
  console.log(`All files that match: ${filenames}`);
});

// start search
sniffer
  .path('/tmp')
  .find('some string');

Documentation

For more examples and API details, see API documentation

Test

npm test

Test Coverage

To generate a test coverage report:

npm run coverage

Contributing

See [contributing guidelines](./CONTRIBUTING.md)