Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiny-fsearch

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-fsearch

A small and versatile file-search library

  • 3.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 18 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc