{"_id":"time-ordered-set","_rev":"481654","name":"time-ordered-set","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:40:05.000Z","created":"2017-01-21T13:14:58.279Z","1.0.2":"2018-09-25T18:09:09.806Z","1.0.1":"2018-09-15T13:03:53.443Z","1.0.0":"2017-01-21T13:14:58.279Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/time-ordered-set.git"},"versions":{"1.0.2":{"name":"time-ordered-set","version":"1.0.2","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","main":"index.js","dependencies":{},"devDependencies":{"standard":"^12.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/time-ordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"homepage":"https://github.com/mafintosh/time-ordered-set","gitHead":"f40494f9acec5a6a877045b8c768e9c277f6bd41","_id":"time-ordered-set@1.0.2","_npmVersion":"6.2.0","_nodeVersion":"10.11.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"3bd931fc048234147f8c2b8b1ebbebb0a3ecb96f","size":2492,"noattachment":false,"key":"/time-ordered-set/-/time-ordered-set-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-ordered-set/download/time-ordered-set-1.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-ordered-set_1.0.2_1537898949455_0.424455424501996"},"_hasShrinkwrap":false,"publish_time":1537898949806,"_cnpm_publish_time":1537898949806},"1.0.1":{"name":"time-ordered-set","version":"1.0.1","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","main":"index.js","dependencies":{},"devDependencies":{"standard":"^12.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/time-ordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"homepage":"https://github.com/mafintosh/time-ordered-set","gitHead":"8736ea853ce549acd91b85b571386eba9de75bbd","_id":"time-ordered-set@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"a94596c645f0c2fbd83b059a36637a2789d1be18","size":2445,"noattachment":false,"key":"/time-ordered-set/-/time-ordered-set-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-ordered-set/download/time-ordered-set-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-ordered-set_1.0.1_1537016633251_0.9925130056307911"},"_hasShrinkwrap":false,"publish_time":1537016633443,"_cnpm_publish_time":1537016633443},"1.0.0":{"name":"time-ordered-set","version":"1.0.0","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","main":"index.js","dependencies":{"standard":"^8.6.0","tape":"^4.6.3"},"devDependencies":{},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/time-ordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"homepage":"https://github.com/mafintosh/time-ordered-set","gitHead":"65ae6f3cafd7e85cf530735f4d494b2ce1b20909","_id":"time-ordered-set@1.0.0","_shasum":"2277f4820c947cf2177db3a7a9e583a5d09e0cc0","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"2277f4820c947cf2177db3a7a9e583a5d09e0cc0","size":2515,"noattachment":false,"key":"/time-ordered-set/-/time-ordered-set-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-ordered-set/download/time-ordered-set-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/time-ordered-set-1.0.0.tgz_1485004497688_0.29700080235488713"},"directories":{},"publish_time":1485004498279,"_cnpm_publish_time":1485004498279,"_hasShrinkwrap":false}},"readme":"# time-ordered-set\n\nEfficiently maintain a set of nodes ordered by the time they were added to the set\n\n```\nnpm install time-ordered-set\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/time-ordered-set.svg?style=flat)](http://travis-ci.org/mafintosh/time-ordered-set)\n\n## Usage\n\n``` js\nvar set = require('time-ordered-set')\nvar s = set()\n\n// add 3 nodes\n\ns.add({\n  hello: 'world'\n})\n\nvar node = s.add({\n  hello: 'welt'\n})\n\ns.add({\n  hello: 'verden'\n})\n\n// re-add the 2nd one\n\ns.add(node)\nconsole.log(s.toArray().map(node => node.hello)) // ['world', 'verden', 'welt']\n```\n\n## API\n\n#### `var s = set()`\n\nCreate a new set\n\n#### `node = s.add(node)`\n\nAdd a new node to the set. Will add the properties `node.next` and `node.prev` to the node.\nRe-adding the same node will move to the latest node.\n\n#### `node = s.remove(node)`\n\nRemove a node. Will set `node.next` and `node.prev` to `null`.\n\n#### `bool = s.has(node)`\n\nCheck if a node has been added.\n\n#### `var array = s.toArray(maxCount)`\n\nGet an ordered array out of all the nodes, ordered from oldest to newest. Set `maxCount` if you only want to get a subset.\n\n#### `s.oldest`\n\nProperty containing the oldest node.\n\n#### `s.latest`\n\nProperty containing the newest node.\n\n#### `s.length`\n\nProperty containing how many nodes are in the set.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/time-ordered-set","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"license":"MIT"}