1.0.1 • Published 2 years ago

@orez/jfind v1.0.1

Weekly downloads
-
License
WTFPL
Repository
github
Last release
2 years ago

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." ]
  }
]