{"_id":"time-ordered-set","_rev":"7-5b8316a4cc047a577faa0755ac7fc5d1","name":"time-ordered-set","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"time-ordered-set","version":"1.0.0","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"time-ordered-set@1.0.0","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/time-ordered-set","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"dist":{"shasum":"2277f4820c947cf2177db3a7a9e583a5d09e0cc0","tarball":"https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-1.0.0.tgz","integrity":"sha512-/B9zpGh5m1h4EjBtKv3RFJor+hdOMbDA8HqmpMRm/pesqVBo7Hs2IO/LgjNtCYfgBsh5kucqk6v+m5e/DTlS7A==","signatures":[{"sig":"MEYCIQDV6N7dvmFLJhqJIw5r6tbY0n1EbrYWv2CHPLq3CxY2CwIhALXxIFGbIOzG0z272aM6+nnqO0DQRu/5HjbGyhlymCSD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"2277f4820c947cf2177db3a7a9e583a5d09e0cc0","gitHead":"65ae6f3cafd7e85cf530735f4d494b2ce1b20909","scripts":{"test":"standard && tape test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"https://github.com/mafintosh/time-ordered-set.git","type":"git"},"_npmVersion":"2.15.11","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","directories":{},"_nodeVersion":"4.7.0","dependencies":{"tape":"^4.6.3","standard":"^8.6.0"},"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/time-ordered-set-1.0.0.tgz_1485004497688_0.29700080235488713","host":"packages-18-east.internal.npmjs.com"}},"1.0.1":{"name":"time-ordered-set","version":"1.0.1","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"time-ordered-set@1.0.1","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/time-ordered-set","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"dist":{"shasum":"a94596c645f0c2fbd83b059a36637a2789d1be18","tarball":"https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-1.0.1.tgz","fileCount":7,"integrity":"sha512-H+uenIh+zckB5+TdJRxZEluREVc8svDgpZjYMX2MYZmnCPj+s1sZYXBq65PgauS9bGySO+t0ulPvFzKxNfYoXQ==","signatures":[{"sig":"MEUCIES+L9IRvP04ZHhdqfzzO9hRDHn1EJfbJpsFIzr9ynFhAiEAzCGkNuMnFvIzV1qAyCRmO6d/qaKzCBwXxmaPBNRuzNc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnQM6CRA9TVsSAnZWagAAuHkP/RFgpUVHp4IyqShgBEDf\nC8LDDfQuZ1pIkmCDZaWkszXjdgnVZ4cIAZldyMq5OFT8A46CXnUGVH3zgTCv\nFhkMKtgnuD0doOjxVPuT4HCYYfoxZeW5JiK+wo++kQobfhv8deYq3VGb4Tto\nf/X8IeD1bYPVz/ieXzNe2Lc9gDF3wah/FcctXzpJpHU9DfAbNWeRpY1eeSyi\nlwu3AJAqdPEJ9ZBcBVQ6q3Tg2jPw4NYt8lZXuHgXqHPaPvn+gfTvf538RQlV\nYDr60qR4rkAqT/S6FTW7nrZ8yQ/mE0sHKdfjfcFHqs22TDFSsMTrd8xbcsz/\nkhOew7Nvv9i0Odb0qsdFWRYoiNPWd806mMpGOYgIbdDfz81X/8SJY6Lvi7yn\nh1eQ0eEoCLWMX8F4KG9fqOfdPsioezHhk/7TUCskDi3Sg7pzHMBzRShmWv60\nZuiq86zoUwZDv+BZrd1k7bVEx/ifNqL370TGR+S61+XUJUc9zpHsVmYatTaZ\nIXl3/cRferrV0s5Ot6QBCz/CKZ+PLLobRq5Y3Y9vFHerIqR00otgKetO4Nte\nn/C0ifYHkWUTniXjDJSPMYYQOtf0ik0U5Pf3Xb6/79YwmZZOjSxv/MWzASYA\nwWmA7z0PJUCYPgg32uJP6HQh9gO2hO8QZ8TsFeJ8yhzymt5wjRqFxbImu+Q1\nUbT+\r\n=bL4A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"8736ea853ce549acd91b85b571386eba9de75bbd","scripts":{"test":"standard && tape test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/time-ordered-set.git","type":"git"},"_npmVersion":"6.2.0","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","directories":{},"_nodeVersion":"10.9.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.9.1","standard":"^12.0.1"},"_npmOperationalInternal":{"tmp":"tmp/time-ordered-set_1.0.1_1537016633251_0.9925130056307911","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"time-ordered-set","version":"1.0.2","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"time-ordered-set@1.0.2","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/time-ordered-set","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"dist":{"shasum":"3bd931fc048234147f8c2b8b1ebbebb0a3ecb96f","tarball":"https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-1.0.2.tgz","fileCount":7,"integrity":"sha512-vGO99JkxvgX+u+LtOKQEpYf31Kj3i/GNwVstfnh4dyINakMgeZCpew1e3Aj+06hEslhtHEd52g7m5IV+o1K8Mw==","signatures":[{"sig":"MEUCIDEV8PEe/etnP7Bv2q3D8H6KjTSSuYuC7Hr8bd0n/BsmAiEArJLNMg7L5FwYf0qlRQ9giTdY76QJ8818F/Vl8x0dBJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqnnGCRA9TVsSAnZWagAAbrcP/3lJHqX0aGIT3HbulDNh\nSYVWZ12gLc3Z82N1wzL0fqQAn1Di7SeURLJX8jiDorCHO6vshagvh8PXpQzQ\nJXRyiMojOpRab5Lgv9U8zBL62ceokCRNYbh1MlbySjaw1Vtnh6EvDbpZT6VU\nwP3NFhaoyMjsZgpgZiY/5iI4drFJ9L/3RzZoVAYAXAPLGPTCnBhzxMmTjUG2\nsr/c1M412uLTHGZHx2sG+sVaWOglvMTAqkjTRE7Jm4lV7Oas4j6PUMVm71nB\nKQGn8c1f2J6ZrsoNTQgn309Linz2emMhyzCVurSQPos1xMaqV7TiDSXwpjgy\nXH3d9W5cMOn91aHUFrMrrT1d/O+szdUmepbgJV97By1GZLeAl9X9UflzYlIo\nRvvMNGOCOlnK7E/7wt1u1nWXJnOmeizRgti6rINzqaky8hjc+/nX0Pxc1M9G\nn+FDSL783s0xheCh+JrrFzN8FbxFTaC/wXD07otGvGYkPEhx5JrEVHcPayII\n3gq+tudLB++OthVoyufn+d9v+bq/vsSD5+7AUlhsXEAj3eDHG+F2Cfnvfid6\nBRTcGaZzHKH3MxKmd3LshGxj388Uz9K709sdjziPGxmTJ1SjFG5nJNbEMv1V\nAAPrsa6dUD1mb0CGgeFfXZV0wv3jYgjNl/igEEwqKc4E+1II12N4xb5/rD3u\nvwW8\r\n=WQrI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"f40494f9acec5a6a877045b8c768e9c277f6bd41","scripts":{"test":"standard && tape test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/time-ordered-set.git","type":"git"},"_npmVersion":"6.2.0","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","directories":{},"_nodeVersion":"10.11.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.9.1","standard":"^12.0.1"},"_npmOperationalInternal":{"tmp":"tmp/time-ordered-set_1.0.2_1537898949455_0.424455424501996","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"time-ordered-set","version":"2.0.0","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"time-ordered-set@2.0.0","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/time-ordered-set","bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"dist":{"shasum":"a6c4f57827ee23701fc122118eb71be7b3c4453a","tarball":"https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-2.0.0.tgz","fileCount":7,"integrity":"sha512-bW/y+G3xukNDhPcnzNujiB3uS7OInWUUegWQ0hccbCShDaMP7ftO0A0DiGZAytU8kgRSPY3ot96EAYVrp3yrnQ==","signatures":[{"sig":"MEQCIHAvM04Q/PAKbwQY+Yvc5dvmW+YskQmwHyzAO2IOh2BrAiA5SczKg4dJdwLwFResXA/S0jaP0g1MAIwhCeWUg+1FIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7727},"main":"index.js","gitHead":"f8e507ab5a784b752dd915a0d899b952ccf7a50b","scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/time-ordered-set.git","type":"git"},"_npmVersion":"10.7.0","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"brittle":"^3.0.0","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/time-ordered-set_2.0.0_1727083357410_0.40016731758585244","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"time-ordered-set","version":"2.0.1","description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","main":"index.js","devDependencies":{"brittle":"^3.0.0","standard":"^17.1.2"},"scripts":{"test":"standard && brittle 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","_id":"time-ordered-set@2.0.1","gitHead":"b518c52066b1a7b8ba5ddf1711f90fd1c87a823e","_nodeVersion":"20.11.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-VJEKmgSN2UiOLB8BpN8Sh2b9LGMHTP5OPrQRpnKjvOheOyzk0mufbjzjKTIG2gO4A+Y+vDJ+0TcLbpUmMLsg8A==","shasum":"66327419aa983a6e8c8f9e1b6832f721462c95b7","tarball":"https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-2.0.1.tgz","fileCount":4,"unpackedSize":4460,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyh28boKRlrwjUg3GK8RS33Byg//EheICLJSDqD69QigIhAMR4eFuVhhoZ7umv6w5KVrbIx4ox4OAVrvNikbcad7es"}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-ordered-set_2.0.1_1728398534141_0.9237152725200135"},"_hasShrinkwrap":false}},"time":{"created":"2017-01-21T13:14:58.279Z","modified":"2024-10-08T14:42:14.499Z","1.0.0":"2017-01-21T13:14:58.279Z","1.0.1":"2018-09-15T13:03:53.443Z","1.0.2":"2018-09-25T18:09:09.806Z","2.0.0":"2024-09-23T09:22:37.593Z","2.0.1":"2024-10-08T14:42:14.369Z"},"bugs":{"url":"https://github.com/mafintosh/time-ordered-set/issues"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","homepage":"https://github.com/mafintosh/time-ordered-set","repository":{"type":"git","url":"git+https://github.com/mafintosh/time-ordered-set.git"},"description":"Efficiently maintain a set of nodes ordered by the time they were added to the set","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"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## Usage\n\n``` js\nconst TOS = require('time-ordered-set')\nconst s = new TOS()\n\n// add 3 nodes\n\ns.add({\n  hello: 'world'\n})\n\nconst 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#### `const s = new TOS()`\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#### `const array = s.toArray([options])`\n\nGet an ordered array out of all the nodes, ordered from oldest to newest. Use `options.reverse: true` to get from newest to oldest. Set `options.limit: number` 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","readmeFilename":"README.md"}