main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Line | |
---|
1 | # ES6 `String.prototype.repeat` polyfill [![Build status](https://travis-ci.org/mathiasbynens/String.prototype.repeat.svg?branch=master)](https://travis-ci.org/mathiasbynens/String.prototype.repeat)
|
---|
2 |
|
---|
3 | A robust & optimized polyfill for [the `String.prototype.repeat` method in ECMAScript 6](http://ecma-international.org/ecma-262/6.0/#sec-string.prototype.repeat).
|
---|
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.repeat).
|
---|
6 |
|
---|
7 | Other polyfills for `String.prototype.repeat` are available:
|
---|
8 |
|
---|
9 | * <https://github.com/paulmillr/es6-shim/blob/d8c4ec246a15e7df55da60b7f9b745af84ca9021/es6-shim.js#L146-L154> by [Paul Miller](http://paulmillr.com/) (~~[fails 8 tests](https://github.com/paulmillr/es6-shim/issues/164)~~ now passes all tests)
|
---|
10 |
|
---|
11 | ## Installation
|
---|
12 |
|
---|
13 | Via [npm](https://www.npmjs.com/):
|
---|
14 |
|
---|
15 | ```bash
|
---|
16 | npm install string.prototype.repeat
|
---|
17 | ```
|
---|
18 |
|
---|
19 | Then, in [Node.js](https://nodejs.org/):
|
---|
20 |
|
---|
21 | ```js
|
---|
22 | var repeat = require('string.prototype.repeat');
|
---|
23 | ```
|
---|
24 |
|
---|
25 | In a browser:
|
---|
26 |
|
---|
27 | ```html
|
---|
28 | <script src="https://bundle.run/string.prototype.repeat"></script>
|
---|
29 | ```
|
---|
30 |
|
---|
31 | > **NOTE**: It's recommended that you install this module using a package manager
|
---|
32 | > such as `npm`, because loading multiple polyfills from a CDN (such as `bundle.run`)
|
---|
33 | > will lead to duplicated code.
|
---|
34 |
|
---|
35 | ## Author
|
---|
36 |
|
---|
37 | | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
---|
38 | |---|
|
---|
39 | | [Mathias Bynens](https://mathiasbynens.be/) |
|
---|
40 |
|
---|
41 | ## License
|
---|
42 |
|
---|
43 | This polyfill is available under the [MIT](https://mths.be/mit) license.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.