The names line, index, lines, and cols can be changed in the second and third style syntaxes
If the return value is false nothing is sent to output stream
If the return value is not a string or number then the line will be sent to the output stream
else the return value will be sent to the output stream (including an empty string)
options
-f js-file or --file=js-file
use the js-file as the function to execute on the input instead of the js-function argument
you must supply either this option or the js-function argument
-1 or --first-line-only
only execute once per file, not for each line
this is useful if you plan on proccessing the file as a whole, namely through the lines variable
for example (not a useful one): nip 'return lines.length' -1 file.txt
By default there are start, end, fileStart, and fileEnd events you can register by doing this.on('end', function() {})
The context inside the main function can be used as a global store, and has a filename property
Why
This is for people who aren't "devops" and who can't crank out a fancy piped shell script using awk and sed. Also most programmers who have node installed can write a quick javascript one+ liner to do what the oldschoolers would make a shell script out of.