35 Commits

Author SHA1 Message Date
Adam Reis
754fd80ff9 [enhance] Allow passing of glob config 2018-03-23 10:29:58 +13:00
Adam Reis
5e64df1c89 Tweaks to readme 2018-03-22 11:47:57 +13:00
CxRes
d94c3aaa49 Callback for from (#46)
* Callback for `from`

Added a callback for `from`, which takes file as an argument. Allows the user to tailor the search string according to the filename.

* Minor Changes to Callback for `from`

Additional comments to explain the callback forms.
Reversed minor version bump.

* Changes to documentation for `to` callback

Reverted to original `to` callback example.
Added a separate example example for using the `file` argument.
2018-03-22 11:42:23 +13:00
Adam Reis
60e7b82f61 Add verbose option 2018-03-07 08:41:45 +13:00
Adam Reis
7bec36e6c5 [bump] Dependencies 2018-02-04 20:25:23 +13:00
Adam Reis
310d37b2fc Fix CLI path resolving for absolute paths 2017-12-21 07:20:06 +13:00
Greg Magolan
a0045eae5d Pass filename as last arg to replacer function (#34)
* Pass filename as last arg to replacer function

* - Cleaned up replacer function override to use ES6
- Added replacer function tests to Async callback & Sync specs
2017-09-15 09:30:53 +12:00
Adam Reis
ae5acca527 Coverage back to 100% 2017-09-14 14:38:09 +12:00
Adam Reis
8b45fe754e Fix tests 2017-09-14 14:30:51 +12:00
Adam Reis
dc3ea7368e 3.0.0
- Drop deprecated API
- Drop support for Node 4 and 5
- Refactor and clean up code base
- Leverage destructuring
- Option to disable globs (#33)
- Update readme
2017-09-14 14:23:05 +12:00
Adam Reis
cf00882d82 Handle undefined ignore param 2017-08-26 08:19:32 +12:00
Adam Reis
4f4991cfe5 Add sync unit test for ignored files 2017-08-25 07:38:33 +12:00
Adam Reis
dae627324e Update readme, fix line length 2017-08-25 07:34:56 +12:00
Kodie Grantham
508ad44b09 Added ignore option (#27)
Ability to ignore files, since Glob doesn't take negated globs anymore since version 4 or 5.
2017-08-25 07:28:43 +12:00
Adam Reis
eee947e744 Add test to prove substring replacement is working 2017-03-12 12:44:20 +13:00
Adam Reis
49b41fe41e Avoid destructuring to support Node 4 & 5 2017-02-15 07:27:43 +13:00
Adam Reis
db4b760d9e CLI functionality 2017-02-13 18:29:46 +13:00
Adam Reis
ec82c43774 Default config, specify encoding, validate config 2017-01-25 13:02:21 +13:00
Adam Reis
cee2844886 Allow multiple replacements at once 2017-01-19 10:10:30 +13:00
Adam Buczynski
83d53e732b Promise API, initial cut 2016-08-10 21:13:29 +12:00
Adam Buczynski
057463396c Arrow functions, drop lower node versions from tests, move helper function out of scope 2016-08-10 20:07:15 +12:00
RyanZim
e0492367b5 Add glob functionality & allowEmptyPaths option
files option can be passed as a glob

When allowEmptyPaths is true, replace-in-file will not throw an error
due to invalid file paths in `files`. Default is false.

Fixes #7
2016-08-09 09:29:00 -04:00
Adam Buczynski
f48a5ce354 Update dependencies, use ESLint, fix line length issues 2016-08-06 16:31:34 +12:00
Fyodor
ef88fda659 remove useless recursion 2016-06-04 03:22:16 +03:00
Adam Buczynski
6759960e10 Add sync replacement 2016-06-03 23:33:19 +12:00
Adam Buczynski
d3aaedf10f Update packages 2016-06-02 16:28:34 +12:00
Adam Buczynski
f90249e9ea Test change to trigger travis 2016-02-16 15:25:00 +13:00
Max Rittmüller
d4f220bee2 Fixed behaviour for passing back array with changed files 2015-11-19 16:44:07 +01:00
Adam Buczynski
f3b9580c75 Replace with new contents, unit tests 2015-07-02 14:50:34 +12:00
Adam Buczynski
d4990715f5 Add return for unchanged contents cb 2015-07-02 13:41:39 +12:00
Adam Buczynski
b1aa42180a Fix #2: return array of changed files in callback 2015-07-02 13:34:58 +12:00
Dave Jeffery
093a6a31ae Don't write a new file if contents are the same as existing file 2015-07-02 02:25:01 +01:00
Adam Buczynski
9c639b70ea Code styling 2015-06-27 11:42:09 +12:00
Adam Buczynski
f5532852b6 Update interface, split in two functions 2015-06-26 06:46:51 +12:00
Adam Buczynski
ee1d1db18c Add gitignore, move to lib 2015-06-25 20:42:53 +12:00