grob
grep, but in JavaScript.
Last updated 2 years ago by thejameskyle .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install grob 
SYNC missed versions from official npm registry.

grob

grep, but in JavaScript.

  • Supports globs using [fast-glob]
  • Faster than grep™†

† Only faster than grep when you are already inside a Node process and would have to spawn a child process to run grep and then parse out the results.

Install

yarn add [--dev] grob

Example

const grob = require('grob');

let matches = await grob({
  cwd: __dirname,
  globs: ['src/**/*.js', '!**/node_modules'],
  regex: /findme/,
});
// Map {
//   "src/index.js" => [{
//     filePath: "/path/to/src/index.js",
//     line: 13,
//     start: 12,
//     end: 18,
//     lineContents: 'console.log(findme);'
//   }]
//   ...
// }

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |