vampire

Count occurances of strings in files.

Usage no npm install needed!

<script type="module">
  import vampire from 'https://cdn.skypack.dev/vampire';
</script>

README

node-vampire

Recursively find patterns in text files.

Usage:  vampire  [ -r | --regex ] [ -j | --json ] <path> ["<glob>"] <pattern>
        vampire  -h | --help

Count the number of occurances of <pattern> in files matching <glob>.

Options:
  -r,--regex  Treat <pattern> as a regular expression.
  -j,--json   Output JSON.
  -h,--help   Show this help text.

<path>
  The root directory in which to search for files. If this is a file and not a
  directory, then <glob> has no effect and the output will be a single number
  indicating then number of times <pattern> was matched.

<glob>
  Filenames relative to <path> must match this glob in order to be searched for
  <pattern>. Should be quoted so that it is passed literally, rather than
  expanded by the shell. Optional: If not given, then all files in <path> will
  be used.

<pattern>
  Literal string or regular expression that will be counted in each file.