broccoli-string-replace

0.1.2 • Public • Published

Broccoli's String Replace

Build Status

Summary

Uses String.prototype.replace to replace matched patterns.

Installation

npm install --save-dev broccoli-string-replace

Usage

Files

Replace VERSION_STRING with 1.6.5 in app/main.js:

var replace = require('broccoli-string-replace');
 
var tree = replace('app', {
  files: [ 'main.js' ],
  pattern: {
    match: /VERSION_STRING/g,
    replacement: '1.6.5'
  }
});

Documentation

replace(inputTree, options)


options.files {Array}

The list of files to process the list of patterns against. This is an array of strings.


options.patterns {Array}

A list of objects with match and replacement properties.


options.pattern {Object}

A single pattern with match and replacement properties.

ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    79,266
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    79,266
  • 0.1.1
    31
  • 0.1.0
    3
  • 0.0.2
    98
  • 0.0.1
    0

Package Sidebar

Install

npm i broccoli-string-replace

Weekly Downloads

79,398

Version

0.1.2

License

MIT

Last publish

Collaborators

  • rwjblue
  • stefanpenner