Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

find-in-file

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-in-file

A simple utility to quickly find text in one or more files.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

find in file

A simple utility to quickly find text in one or more files.

Installation

npm install find-in-file

Usage

var replace = require('replace-in-file');
replace({

  //Single file
  files: 'path/to/file',

  //Or multiple files
  files: [
    'path/to/file',
    'path/to/other/file',
  ],

  //Find a regex
  find: /Find\sme/g,

  //Or a string
  find: 'Find me',
}, function(err, matchedFiles) {
  /*
    matchedFiles => [ { file: 'test1.json', occurrences: 1 },
                      { file: 'test2.json', occurrences: 2 } ]
  */
});

License

(MIT License)

Copyright 2015, Dave Jeffery (Original Fork by Adam Buczynski)

Keywords

find

FAQs

Package last updated on 03 Jul 2015

Did you know?

Socket

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