replacefile
v1.0.0
Published
Find and replace text in a file
Downloads
8
Maintainers
Readme
replacefile
Find and replace text in a file.
Installation
Install replacefile
by running:
$ npm install --save replacefile
Documentation
replacefile.replace(file, regex, replacement) ⇒ Promise
Kind: static method of replacefile
Summary: Replace the contents of a file
Access: public
| Param | Type | Description | | --- | --- | --- | | file | String | file path | | regex | RegExp | regex | | replacement | String | replacement |
Example
replacefile.replace('foo/bar/config.txt', /^GPUMEM.*$/g, 'GPUMEM=128')
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Tests
Run the test suite by doing:
$ gulp test
Contribute
- Issue Tracker: github.com/jviotti/replacefile/issues
- Source Code: github.com/jviotti/replacefile
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
License
The project is licensed under the MIT license.