Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
martincizek committed May 30, 2020
1 parent 2a26bf9 commit 270f379
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ In [Node.js](http://nodejs.org/):
const UnionReplacer = require('union-replacer');
```
With [TypeScript](https://www.typescriptlang.org/):
```js
// with esModuleInterop enabled in tsconfig (recommended):
import UnionReplacer from 'union-replacer';
// without esModuleInterop enabled in tsconfig:
import * as UnionReplacer from 'union-replacer';
// regardless esModuleInterop setting:
import UnionReplacer = require('union-replacer');
```
### Synopsis
```
Expand All @@ -47,7 +57,7 @@ newStr = replacer.replace(str)
- v2.0 removes the `addReplacement()` method, see
[#4](https://github.com/orchitech/union-replacer/issues/4) for details.
- v2.0 introduces TypeScript type definitions.
- v2.0 introduces TypeScript type definitions along with precise JSDoc type definitions.
## Examples
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "union-replacer",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta.1",
"description": "One-pass String.prototype.replace-like processor with multiple regexps and replacements",
"main": "dist/union-replacer.cjs.js",
"module": "dist/union-replacer.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for union-replacer 2.0.0-beta.0
// Type definitions for union-replacer 2.0.0-beta.1
// File generated by tsd-jsdoc and scripts/tsd-postprocess.js.
// Do not modify directly.

Expand Down

0 comments on commit 270f379

Please sign in to comment.