3.1.0 • Published 1 year ago

tiny-fsearch v3.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

tiny-fsearch

Fast and simple file-in-file methods for NodeJS.

Getting Started

tiny-fsearch exposes both a native Node module and cross-platform grep functionality. It can be installed via:

npm install tiny-fsearch

Usage

The module consists of both "sycnhronous" and "streamed" match outputs for single find-in-file queries.

// ES Syntax (other require is fine for CommonJS)
import { FSearch } from 'tiny-fsearch';

// predicates/resources
const predicate: string = 'search value';
const filePath: string = 'file-to-search';

/// Synchronous File-Searching
FSearch.Sync.query(predicate, { filePath });
FSearch.Sync.grep(predicate, { filePath });

/// Streamed File-Searching
FSearch.Stream.grep(predicate, { filePath });

Search Options

interface FSearch.Options {
    limit?: number;
    isRegExp?: boolean;
    ignoreCase?: boolean;
    matchWholeWord?: boolean;
}

Match Results

interface FSearch.Result {
    line: number;
    column: number;
    content: string;
}

License

MIT

3.0.3

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago