Skip to content

Commit 15ba134

Browse files
Update readme
1 parent 1baf690 commit 15ba134

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ES6 `String.prototype.endsWith` polyfill [![Build status](https://travis-ci.org/mathiasbynens/String.prototype.endsWith.svg?branch=master)](https://travis-ci.org/mathiasbynens/String.prototype.endsWith)
22

3-
A robust & optimized ES3-compatible polyfill for [the `String.prototype.endsWith` method in ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).
3+
A robust & optimized polyfill for [the `String.prototype.endsWith` method in ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).
4+
5+
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-string.prototype.endswith).
46

57
Other polyfills for `String.prototype.endsWith` are available:
68

@@ -9,12 +11,6 @@ Other polyfills for `String.prototype.endsWith` are available:
911

1012
## Installation
1113

12-
In a browser:
13-
14-
```html
15-
<script src="endswith.js"></script>
16-
```
17-
1814
Via [npm](http://npmjs.org/):
1915

2016
```bash
@@ -24,13 +20,17 @@ npm install string.prototype.endswith
2420
Then, in [Node.js](http://nodejs.org/):
2521

2622
```js
27-
require('string.prototype.endswith');
23+
var endsWith = require('string.prototype.endswith');
24+
```
2825

29-
// On Windows and on Mac systems with default settings, case doesn’t matter,
30-
// which allows you to do this instead:
31-
require('String.prototype.endsWith');
26+
```html
27+
<script src="https://bundle.run/string.prototype.endswith"></script>
3228
```
3329

30+
> **NOTE**: It's recommended that you install this module using a package manager
31+
> such as `npm`, because loading multiple polyfills from a CDN (such as `bundle.run`)
32+
> will lead to duplicated code.
33+
3434
## Notes
3535

3636
Polyfills + test suites for [`String.prototype.startsWith`](https://mths.be/startswith) and [`String.prototype.contains`](https://mths.be/contains) are available, too.

0 commit comments

Comments
 (0)