» Make grep CLI App in Node.js » 1. Introduction » 1.2 Objectives

Project Objectives

This project is aimed to implement a grep-like CLI app in Node.js, named lr_grepjs1.

It should be used like this:

grepjs [-cinrv] [pattern] [file ...]

The following options should be available:

-c, --count
    Only a count of selected lines is written to standard output.

-h  Print a brief help message.

-i, --ignore-case
    Perform case insensitive matching.  By default, it is case sensitive.

-n, --line-number
    Each output line is preceded by its relative line number in the file, starting at line 1. 
    The line number counter is reset for each file processed.  This option is ignored if -c is specified.

-r, --recursive
    Recursively search subdirectories listed.

-v, --invert-match
    Selected lines are those not matching any of the specified patterns.

Footnotes

  1. lr_ is the prefix of LiteRank, and grepjs means grep + js.

PrevNext