Skip to content

A small wrapper around the excellent ripgrep binary

License

Notifications You must be signed in to change notification settings

allancalix/ripgrep-bin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ripgrep-bin


About

A simple wrapper around Ripgrep that allows for use in node. This package exists solely to make it convenient to call and bundle Ripgrep with Node applications.

This package can also be used to install the Ripgrep cli through node.

Installation

# Installs globally for binary access.
npm i -g ripgrep-bin
# Check version, note the name is different from the canonical version (rg).
ripgrep --version

Use

// index.js
const execFile = require('child_process').execFile;
const ripgrep = require('ripgrep-bin');

execFile(ripgrep, ['hello'], (err, stdout) => {
  if (err) throw err;
  console.log(stdout);
});