2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2015-06-28 20:44:43 +12:00
2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2016-02-16 15:20:46 +13:00
2015-06-25 20:43:06 +12:00
2016-02-16 15:20:46 +13:00
2015-11-20 07:45:16 +13:00

Replace in file

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

Installation

npm install replace-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',
  ],

  //Replacement to make (can be string or regex)
  replace: /Find me/g,
  with: 'Replacement'

}, function(error, changedFiles) {

  //Catch errors
  if (error) {
    return console.error('Error occurred:', error);
  }

  //List changed files
  console.log('Modified files:', changedFiles.join(', '));
});

License

(MIT License)

Copyright 2015, Adam Buczynski

Description
No description provided
Readme 372 KiB
Languages
JavaScript 100%