1.0.1 • Published 9 years ago

find-in-file v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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)