{"name":"stringset","version":"0.2.1","description":"fast and robust stringset","main":"stringset.js","repository":{"type":"git","url":"https://github.com/olov/stringset.git"},"keywords":["stringset","set","__proto__"],"author":{"name":"Olov Lassus","email":"olov.lassus@gmail.com"},"license":"MIT","readme":"# stringset.js\nA fast and robust stringset implementation that can hold any string items,\nincluding `__proto__`, with minimal overhead compared to a plain object.\nWorks in node and browsers.\n\nThe API is created to be as close to the ES6 Set API as possible. Prefer\n`ss.remove(\"key\")` for deleting a key. ES6 Set uses `set.delete(\"key\")`\ninstead and for that reason `ss['delete'](\"key\")` is available as a\nstringset alias as well. Never do `ss.delete(\"key\")` unless you're\ncertain to be in the land of ES5 or later.\n\n\n\n## Examples\nAvailable in `examples.js`\n\n```javascript\nvar StringSet = require(\"stringset\");\n\nvar ss1 = new StringSet();\nss1.add(\"greeting\");\nss1.add(\"check\");\nss1.add(\"__proto__\");\nconsole.log(ss1.has(\"greeting\")); // true\nconsole.log(ss1.has(\"__proto__\")); // true\nss1.remove(\"greeting\");\nconsole.log(ss1.items()); // [ 'check', '__proto__' ]\nconsole.log(ss1.toString()); // {\"check\",\"__proto__\"}\n\nvar ss2 = new StringSet([\"one\", \"two\"]);\nconsole.log(ss2.isEmpty()); // false\nconsole.log(ss2.size()); // 2\n\nvar ss3 = ss1.clone();\nss3.merge(ss2);\nss3.addMany([\"a\", \"b\"]);\nconsole.log(ss3.toString()); // {\"check\",\"one\",\"two\",\"a\",\"b\",\"__proto__\"}\n```\n\n\n\n## Installation\n\n### Node\nInstall using npm\n\n    npm install stringset\n\n```javascript\nvar StringSet = require(\"stringset\");\n```\n\n### Browser\nClone the repo and include it in a script tag\n\n    git clone https://github.com/olov/stringset.git\n\n```html\n<script src=\"stringset/stringset.js\"></script>\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/olov/stringset/issues"},"homepage":"https://github.com/olov/stringset","_id":"stringset@0.2.1","_shasum":"ef259c4e349344377fcd1c913dd2e848c9c042b5","_from":"https://registry.npmjs.org/stringset/-/stringset-0.2.1.tgz","_resolved":"https://registry.npmjs.org/stringset/-/stringset-0.2.1.tgz"}