@orez/jfind

1.0.1 • Public • Published

jfind

Search the content of all files located within a designated directory.

Usage

Command Line

pnpm i @orez/jfind -g

Find "hello" in all txt files in the current directory, and ignore case sensitivity.

jfind . -p hello -f *.txt -i

Complex matching rules

The command line cannot directly input complex regular expressions. So, don't set p, instead of whole line input.

jfind . -f *.txt -i
Input complex pattern: ^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$

Module

pnpm i @orez/jfind -S
import jfind from '@orez/jfind'

jfind.find(/hello/ig, '.', '*.txt')
    .then(results => console.log(results))

// results
[
  {
    filename: 'test\\2.txt',
    matches: [ 'Hello' ],
    lines: [ "Hello! I'm justorez." ]
  }
]

Package Sidebar

Install

npm i @orez/jfind

Weekly Downloads

1

Version

1.0.1

License

WTFPL

Unpacked Size

5.17 kB

Total Files

4

Last publish

Collaborators

  • justorez