{"_id":"memory-pager","_rev":"120528","name":"memory-pager","description":"Access memory using small fixed sized buffers","dist-tags":{"latest":"1.5.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-06-03T10:56:14.000Z","created":"2017-03-03T14:12:27.152Z","1.5.0":"2019-01-09T15:38:24.901Z","1.4.0":"2018-12-21T19:36:14.749Z","1.3.1":"2018-12-10T20:43:42.135Z","1.3.0":"2018-12-10T10:26:18.380Z","1.2.0":"2018-12-09T19:15:15.958Z","1.1.0":"2017-10-22T19:31:31.114Z","1.0.3":"2017-03-03T15:36:28.687Z","1.0.2":"2017-03-03T14:49:01.247Z","1.0.1":"2017-03-03T14:45:00.372Z","1.0.0":"2017-03-03T14:12:27.152Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"versions":{"1.5.0":{"name":"memory-pager","version":"1.5.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"bccc3652145f9ceaaf1035ff1258580ca39d465d","_id":"memory-pager@1.5.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"d8751655d22d384682741c972f2c3d6dfa3e66b5","size":3107,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.5.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager_1.5.0_1547048304675_0.7412715036396982"},"_hasShrinkwrap":false,"publish_time":1547048304901,"_cnpm_publish_time":1547048304901},"1.4.0":{"name":"memory-pager","version":"1.4.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"9e963dea8db1d3984b6970faa01322b107f7de79","_id":"memory-pager@1.4.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"8902c72ce2fa34319adc0dae586b7d83cec6d6ac","size":2871,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.4.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager_1.4.0_1545420974639_0.2565993625101879"},"_hasShrinkwrap":false,"publish_time":1545420974749,"_cnpm_publish_time":1545420974749},"1.3.1":{"name":"memory-pager","version":"1.3.1","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"99a4c9d4d12fe95ae6d039746372609fe25a4257","_id":"memory-pager@1.3.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"1153d2f5e157a407a436bf54ccf4139037515866","size":2845,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.3.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager_1.3.1_1544474621935_0.03567664867642617"},"_hasShrinkwrap":false,"publish_time":1544474622135,"_cnpm_publish_time":1544474622135},"1.3.0":{"name":"memory-pager","version":"1.3.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"60647446223390f40fe8552ded8259540c3a21f2","_id":"memory-pager@1.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"1e231e454c784c3bdfbcc45d076a0f9edb950e51","size":2846,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.3.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager_1.3.0_1544437578287_0.6617617544019025"},"_hasShrinkwrap":false,"publish_time":1544437578380,"_cnpm_publish_time":1544437578380},"1.2.0":{"name":"memory-pager","version":"1.2.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"96f72b1c3e00b796144819850fe1c0e06755e398","_id":"memory-pager@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"02298c7045419aa02f9a8bb2143c522eec8aa5ac","size":2764,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.2.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager_1.2.0_1544382915733_0.5160668179582"},"_hasShrinkwrap":false,"publish_time":1544382915958,"_cnpm_publish_time":1544382915958},"1.1.0":{"name":"memory-pager","version":"1.1.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"500039368d57728f723b03b7f4ea873756c33e87","_id":"memory-pager@1.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"9308915e0e972849fefbae6f8bc95d6b350e7344","size":2665,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-pager-1.1.0.tgz_1508700690189_0.6682389550842345"},"directories":{},"publish_time":1508700691114,"_hasShrinkwrap":false,"_cnpm_publish_time":1508700691114},"1.0.3":{"name":"memory-pager","version":"1.0.3","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"28d99b6b5ef83670269474a51a7aef01e5b58b2d","_id":"memory-pager@1.0.3","_shasum":"037812003e66abedcc84cca722c425590e8faa88","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"037812003e66abedcc84cca722c425590e8faa88","size":2723,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.0.3.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/memory-pager-1.0.3.tgz_1488555386804_0.8733963379636407"},"directories":{},"publish_time":1488555388687,"_cnpm_publish_time":1488555388687,"_hasShrinkwrap":false},"1.0.2":{"name":"memory-pager","version":"1.0.2","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"1b630de1791053eee3c77c38020b67e2613daab9","_id":"memory-pager@1.0.2","_shasum":"5bb54d8a9acd3f6cffbc15bccda256ecd8daeeea","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"5bb54d8a9acd3f6cffbc15bccda256ecd8daeeea","size":2711,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/memory-pager-1.0.2.tgz_1488552539318_0.9215729413554072"},"directories":{},"publish_time":1488552541247,"_cnpm_publish_time":1488552541247,"_hasShrinkwrap":false},"1.0.1":{"name":"memory-pager","version":"1.0.1","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"c7c937338f10c1a0d6bc5cb2c17575b9f2686c7b","_id":"memory-pager@1.0.1","_shasum":"9de7effcf408b1f58a67e4665b33e47d685519a3","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"9de7effcf408b1f58a67e4665b33e47d685519a3","size":2710,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/memory-pager-1.0.1.tgz_1488552299785_0.24090905277989805"},"directories":{},"publish_time":1488552300372,"_cnpm_publish_time":1488552300372,"_hasShrinkwrap":false},"1.0.0":{"name":"memory-pager","version":"1.0.0","description":"Access memory using small fixed sized buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/memory-pager.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"homepage":"https://github.com/mafintosh/memory-pager","gitHead":"67d600344f40e004232b8ad33b83e367d66b9224","_id":"memory-pager@1.0.0","_shasum":"9f3342c48e3dc22e08c2ee470cb84059c6e88348","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"9f3342c48e3dc22e08c2ee470cb84059c6e88348","size":2641,"noattachment":false,"key":"/memory-pager/-/memory-pager-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/memory-pager/download/memory-pager-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/memory-pager-1.0.0.tgz_1488550346549_0.6191987448837608"},"directories":{},"publish_time":1488550347152,"_cnpm_publish_time":1488550347152,"_hasShrinkwrap":false}},"readme":"# memory-pager\n\nAccess memory using small fixed sized buffers instead of allocating a huge buffer.\nUseful if you are implementing sparse data structures (such as large bitfield).\n\n![travis](https://travis-ci.org/mafintosh/memory-pager.svg?branch=master)\n\n```\nnpm install memory-pager\n```\n\n## Usage\n\n``` js\nvar pager = require('paged-memory')\n\nvar pages = pager(1024) // use 1kb per page\n\nvar page = pages.get(10) // get page #10\n\nconsole.log(page.offset) // 10240\nconsole.log(page.buffer) // a blank 1kb buffer\n```\n\n## API\n\n#### `var pages = pager(pageSize)`\n\nCreate a new pager. `pageSize` defaults to `1024`.\n\n#### `var page = pages.get(pageNumber, [noAllocate])`\n\nGet a page. The page will be allocated at first access.\n\nOptionally you can set the `noAllocate` flag which will make the\nmethod return undefined if no page has been allocated already\n\nA page looks like this\n\n``` js\n{\n  offset: byteOffset,\n  buffer: bufferWithPageSize\n}\n```\n\n#### `pages.set(pageNumber, buffer)`\n\nExplicitly set the buffer for a page.\n\n#### `pages.updated(page)`\n\nMark a page as updated.\n\n#### `pages.lastUpdate()`\n\nGet the last page that was updated.\n\n#### `var buf = pages.toBuffer()`\n\nConcat all pages allocated pages into a single buffer\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/memory-pager","bugs":{"url":"https://github.com/mafintosh/memory-pager/issues"},"license":"MIT"}