Socket
Socket
Sign inDemoInstall

grepr

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grepr

node.js module that implements a recursive grep function.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
22.9 kB
Created
Weekly downloads
 

Readme

Source

grepr

Installation

npm install grepr

Usage

Function signature is function(string,dir,callback) where:

  • string: is the string to search;
  • dir: is directory where the search starts;
  • callback: is a function of type function(file,indices,lines) where file is the complete file path where the input string has been found, indices is an array of line index and lines is the array of lines containing the string.

Callback is called only on those files containing at least one occurrence of the input string.

For example this call search in the current directory the word npm:

var grepr = require('grepr');

grepr("npm","./", function(file,indices,lines){
	console.log("FOUND in "+file);
	console.log("INDICES\n"+indices);
	console.log("LINES\n"+lines);
});

Tools

Created with Nodeclipse (Eclipse Marketplace, site)

Nodeclipse is free open-source project that grows with your contributions.

Keywords

FAQs

Last updated on 13 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc