string-replace-async
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,2 +0,2 @@ | ||
module.exports = function replaceAsync(string, searchValue, replacer) { | ||
export default function replaceAsync(string, searchValue, replacer) { | ||
try { | ||
@@ -25,2 +25,2 @@ if (typeof replacer === "function") { | ||
} | ||
}; | ||
} |
{ | ||
"name": "string-replace-async", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Asynchronous String.prototype.replace()", | ||
@@ -12,4 +12,5 @@ "license": "MIT", | ||
}, | ||
"type": "module", | ||
"engines": { | ||
"node": ">=0.12" | ||
"node": ">= 14.0.0" | ||
}, | ||
@@ -16,0 +17,0 @@ "scripts": { |
@@ -11,6 +11,12 @@ # string-replace-async | ||
**Note:** If you're using pre-14 version of Node or your node codebase isn't converted to [ES Modules](https://nodejs.org/api/esm.html#esm_introduction) yet, please use Version 2 specifically! | ||
``` | ||
$ npm install string-replace-async@^2.0.0 | ||
``` | ||
## Usage | ||
```js | ||
let replaceAsync = require("string-replace-async"); | ||
import replaceAsync from "string-replace-async"; | ||
@@ -17,0 +23,0 @@ await replaceAsync("#rebeccapurple", /#(\w+)/g, async (match, name) => { |
7024
121
Yes