JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 84
  • Score
    100M100P100Q66032F
  • License MIT

Node.js wrapper around Ripgrep

Package Exports

  • ripgrep-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ripgrep-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ripgrep-js

A Node.js wrapper around ripgrep

Note: I have nothing to do with ripgrep or the search functionality of this JS library. This is only a wrapper to expose ripgrep results in Node.js. All credit for the underlying tool go to @BurntSushi and the lovely contributors to his project.

Usage

const rg = require('ripgrep-js');

// Give `rg` an absolute path to search in and the search term
rg('path/to/search', 'foo').then((result) => {
  // `result` is an array of matches
  const [ firstMatch ] = results;

  // Match info provided by each result object
  const { file, column, line, match } = firstMatch;
});