UNPKG

canonical

Version:

Canonical code style linter and formatter for JavaScript, SCSS and CSS.

80 lines (79 loc) 4.46 kB
{ "_args": [ [ "es6-map@https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "/Users/gajus/Documents/dev/canonical-code-style/canonical" ] ], "_from": "es6-map@>=0.1.2 <0.2.0", "_id": "es6-map@0.1.3", "_inCache": true, "_location": "/es6-map", "_phantomChildren": {}, "_requested": { "name": "es6-map", "raw": "es6-map@https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "rawSpec": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "scope": null, "spec": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "type": "remote" }, "_requiredBy": [ "/escope" ], "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "_shasum": "fe58c6654c6acd54e4397cdb72379d59b6ad5894", "_shrinkwrap": null, "_spec": "es6-map@https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "_where": "/Users/gajus/Documents/dev/canonical-code-style/canonical", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", "url": "http://www.medikoo.com/" }, "bugs": { "url": "https://github.com/medikoo/es6-map/issues" }, "dependencies": { "d": "~0.1.1", "es5-ext": "~0.10.8", "es6-iterator": "2", "es6-set": "~0.1.3", "es6-symbol": "~3.0.1", "event-emitter": "~0.3.4" }, "description": "ECMAScript6 Map polyfill", "devDependencies": { "tad": "~0.2.4", "xlint": "~0.2.2", "xlint-jslint-medikoo": "~0.1.4" }, "homepage": "https://github.com/medikoo/es6-map#readme", "keywords": [ "collection", "ecmascript", "es6", "harmony", "hash", "list", "map", "polyfill", "ponyfill", "shim" ], "license": "MIT", "name": "es6-map", "optionalDependencies": {}, "readme": "# es6-map\n## Map collection as specified in ECMAScript6\n\n### Usage\n\nIt’s safest to use *es6-map* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects:\n\n```javascript\nvar Map = require('es6-map');\n```\n\nIf you want to make sure your environment implements `Map` globally, do:\n\n```javascript\nrequire('es6-map/implement');\n```\n\nIf you strictly want to use the polyfill even if the native `Map` exists, do:\n\n```javascript\nvar Map = require('es6-map/polyfill');\n```\n\n### Installation\n\n\t$ npm install es6-map\n\t\nTo port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)\n\n#### API\n\nBest is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects). Still if you want quick look, follow examples:\n\n```javascript\nvar Map = require('es6-map');\n\nvar x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]);\n\nmap.size; // 3\nmap.get('raz'); // 'one'\nmap.get(x); // y\nmap.has('raz'); // true\nmap.has(x); // true\nmap.has('foo'); // false\nmap.set('trzy', 'three'); // map\nmap.size // 4\nmap.get('trzy'); // 'three'\nmap.has('trzy'); // true\nmap.has('dwa'); // true\nmap.delete('dwa'); // true\nmap.size; // 3\n\nmap.forEach(function (value, key) {\n // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated\n});\n\n// FF nightly only:\nfor (value of map) {\n // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated\n}\n\nvar iterator = map.values();\n\niterator.next(); // { done: false, value: 'one' }\niterator.next(); // { done: false, value: y }\niterator.next(); // { done: false, value: 'three' }\niterator.next(); // { done: true, value: undefined }\n\nmap.clear(); // undefined\nmap.size; // 0\n```\n\n## Tests [![Build Status](https://travis-ci.org/medikoo/es6-map.png)](https://travis-ci.org/medikoo/es6-map)\n\n\t$ npm test\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/medikoo/es6-map.git" }, "scripts": { "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "version": "0.1.3" }