The functionality of the `grep` linux command made in node.js with replace
You can install globally with:
npm install -g grape-regexp
You can use:
-
grape find "pattern" <filepath>
to print all the lines that contain a match -
grape transfer "pattern" <pathToCheck> <pathToDeposit>
to transfers all the lines with a match in<pathToCheck>
to<pathToDeposit>
-
grape replace "pattern" "replaceValue" <filepath>
to replace all matches of"pattern"
with"replaceValue"
, but before that writes the file contents to a save file so that if a mistake was made, you can revert it -
grape read <filepath>
to print the entire contents of a file -
grape revert [filename]
, if a filename is not provided then grape will show a list of all replace saves from you to choose from and manually revert. If a filename/path is provided then grape show a list of all saves that contain the path inputted