-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
41 lines (41 loc) · 2.69 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
"name": "es6-symbol",
"version": "0.1.0",
"description": "ECMAScript6 Symbol polyfill",
"author": {
"name": "Mariusz Nowak",
"email": "medyk@medikoo.com",
"url": "http://www.medikoo.com/"
},
"keywords": [
"symbol",
"private",
"property",
"es6",
"ecmascript",
"harmony"
],
"repository": {
"type": "git",
"url": "git://github.com/medikoo/es6-symbol.git"
},
"dependencies": {
"d": "~0.1.1",
"es5-ext": "~0.10.2"
},
"devDependencies": {
"tad": "0.2.x"
},
"scripts": {
"test": "node ./node_modules/tad/bin/tad"
},
"license": "MIT",
"readme": "# es6-symbol\n## ECMAScript6 Symbol polyfill\n\n### Limitations\n\n- Underneath it uses real string property names which can easily be retrieved (however accidental collision with other property names is unlikely)\n- As it needs custom `toString` behavior to work properly. Original `Symbol.prototoype.toString` couldn't be implemented as specified, still it's accessible as `Symbol.prototoype.properToString`\n\n### Usage\n\nIf you want to make sure your environment implements `Symbol`, do:\n\n```javascript\nrequire('es6-symbol/implement');\n```\n\nIf you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Symbol` on global scope, do:\n\n```javascript\nvar Symbol = require('es6-symbol');\n```\n\nIf you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:\n\n```javascript\nvar Symbol = require('es6-symbol/polyfill');\n```\n\n#### API\n\nBest is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:\n\n```javascript\nvar Symbol = require('es6-symbol');\n\nvar symbol = Symbol('My custom symbol');\nvar x = {};\n\nx[symbol] = 'foo';\nconsole.log(x[symbol]); 'foo'\n\n// Detect iterable:\nvar iterator, result;\nif (possiblyIterable[Symbol.iterator]) {\n iterator = possiblyIterable[Symbol.iterator]();\n result = iterator.next();\n while(!result.done) {\n console.log(result.value);\n result = iterator.next();\n }\n}\n```\n\n### Installation\n#### NPM\n\nIn your project path:\n\n\t$ npm install es6-symbol\n\n##### Browser\n\nYou can easily bundle _es6-symbol_ for browser with [modules-webmake](https://github.com/medikoo/modules-webmake)\n\n## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)\n\n\t$ npm test\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/medikoo/es6-symbol/issues"
},
"homepage": "https://github.com/medikoo/es6-symbol",
"_id": "es6-symbol@0.1.0",
"_from": "es6-symbol@0.1.x"
}