# broccoli-string-replace

> Broccoli plugin to replace a matched string with a replacement.

Latest version **0.1.2** (published 2017-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-string-replace
pnpm add broccoli-string-replace
yarn add broccoli-string-replace
bun add broccoli-string-replace
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-02-19 |
| First published | 2014-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Robert Jackson |
| Maintainers | rwjblue, stefanpenner |
| Keywords | broccoli-plugin, javascript |

## Links

- npm: https://www.npmjs.com/package/broccoli-string-replace
- Repository: https://github.com/rwjblue/broccoli-string-replace
- Homepage: https://github.com/rwjblue/broccoli-string-replace#readme
- Issues: https://github.com/rwjblue/broccoli-string-replace/issues
- npm.io page: https://npm.io/package/broccoli-string-replace

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^3.0.3
- [broccoli-persistent-filter](https://npm.io/package/broccoli-persistent-filter.md) ^1.1.5

## Recent versions

- 0.1.2 (latest) — 2017-02-19
- 0.1.1 — 2015-11-04
- 0.1.0 — 2015-07-10
- 0.0.2 — 2014-07-11
- 0.0.1 — 2014-07-10

## README

# Broccoli's String Replace

[![Build Status](https://travis-ci.org/rwjblue/broccoli-string-replace.svg?branch=master)](https://travis-ci.org/rjackson/broccoli-string-replace)

## Summary

Uses [String.prototype.replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) to
replace matched patterns.

## Installation

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

## Usage

### Files

Replace `VERSION_STRING` with `1.6.5` in `app/main.js`:

```javascript
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:

```javascript
npm install
npm test
```

## License

This project is distributed under the MIT license.

---
_Source: https://npm.io/package/broccoli-string-replace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
