Skip to content

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

Notifications You must be signed in to change notification settings

justorez/find-in-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published