Skip to content

Search and replace text strings in your GobbleJS workflow

Notifications You must be signed in to change notification settings

gobblejs/gobble-searchreplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

gobble-searchreplace

Search and replace text strings in your GobbleJS workflow

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm i -D gobble-searchreplace

Usage

In your gobblefile.js:

var gobble = require( 'gobble' );
module.exports = gobble( 'src' ).transform( 'searchreplace', {
  // Search for all instances of "foo"...
  search: 'foo',

  // ... and replace them with "bar".
  replace: 'bar'
});

The search and replace options behave exactly as the parameters for String.replace().

This means that the search option can be a String or a RegExp, and the replace option can be a String or a Function. Check the documentation for String.replace() for details.

License

"THE BEER-WARE LICENSE":
<[email protected]> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return.

About

Search and replace text strings in your GobbleJS workflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published