replacefile

1.0.0 • Public • Published

replacefile

npm version dependencies Build Status Build status

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

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.

Package Sidebar

Install

npm i replacefile

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jviotti