1 | # replaceall [![Build Status](https://travis-ci.org/leecrossley/replaceall.png?branch=master)](https://travis-ci.org/leecrossley/replaceall) [![npm version](https://badge.fury.io/js/replaceall.png)](https://npmjs.org/package/replaceall) [![devDependency Status](https://david-dm.org/leecrossley/replaceall/dev-status.png)](https://david-dm.org/leecrossley/replaceall#info=devDependencies)
|
2 |
|
3 | Replace all instances in a JavaScript string.
|
4 |
|
5 | ### Install with npm
|
6 |
|
7 | ```
|
8 | npm install replaceall
|
9 | ```
|
10 |
|
11 | To then include replaceall in your node app:
|
12 |
|
13 | ```
|
14 | var replaceall = require("replaceall");
|
15 | ```
|
16 |
|
17 | ### Using replaceall
|
18 |
|
19 | ```js
|
20 | var result = replaceall("instances of this", "with this string", "in this string");
|
21 | ```
|
22 |
|
23 | ### Example
|
24 |
|
25 | ```js
|
26 | var original = "hello world goodbye world";
|
27 |
|
28 | replaceall("world", "everyone", original);
|
29 | // "hello everyone goodbye everyone"
|
30 |
|
31 | replaceall("l", "z", original);
|
32 | // "hezzo worzd goodbye worzd"
|
33 | ```
|
34 |
|
35 | ## License
|
36 |
|
37 | [MIT License](http://ilee.mit-license.org)
|