{"_id":"lomstream","_rev":"4251811","name":"lomstream","description":"limit, offset, marker stream","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"bahamat","email":""},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"rm","email":"rm@fingolfin.org"}],"time":{"modified":"2026-03-31T23:46:46.000Z","created":"2015-07-31T22:54:31.714Z","1.1.1":"2021-11-02T21:04:52.848Z","1.1.0":"2015-08-20T18:11:20.503Z","1.0.0":"2015-07-31T22:54:31.714Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/joyent/node-lomstream.git"},"versions":{"1.1.1":{"name":"lomstream","version":"1.1.1","description":"limit, offset, marker stream","main":"lib/lomstream.js","repository":{"type":"git","url":"git+https://github.com/joyent/node-lomstream.git"},"dependencies":{"assert-plus":"0.1.5","extsprintf":"1.3.0","vstream":"0.1.0"},"license":"MIT","gitHead":"45ecc49dd2871625e6707687e4ddf533e2965a67","bugs":{"url":"https://github.com/joyent/node-lomstream/issues"},"homepage":"https://github.com/joyent/node-lomstream#readme","_id":"lomstream@1.1.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.13","dist":{"shasum":"40b41670aae54b7bd29a8654866b8200234484b7","size":6001,"noattachment":false,"key":"/lomstream/-/lomstream-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lomstream/download/lomstream-1.1.1.tgz"},"_npmUser":{"name":"bahamat","email":"bahamat@digitalelf.net"},"directories":{},"maintainers":[{"name":"bahamat","email":""},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"rm","email":"rm@fingolfin.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lomstream_1.1.1_1635887092679_0.5441920864085616"},"_hasShrinkwrap":false,"publish_time":1635887092848,"_cnpm_publish_time":1635887092848,"_cnpmcore_publish_time":"2021-12-16T23:06:39.299Z"},"1.1.0":{"name":"lomstream","version":"1.1.0","description":"limit, offset, marker stream","main":"lib/lomstream.js","repository":{"type":"git","url":"git://github.com/joyent/node-lomstream.git"},"dependencies":{"assert-plus":"0.1.5","extsprintf":"1.3.0","vstream":"0.1.0"},"license":"MIT","gitHead":"2e82c875e046d18a177701c93a30a56bc73f5b5b","bugs":{"url":"https://github.com/joyent/node-lomstream/issues"},"homepage":"https://github.com/joyent/node-lomstream#readme","_id":"lomstream@1.1.0","scripts":{},"_shasum":"2a7f8066ec3ab40bef28ca384842e75340183bf0","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"jclulow","email":"josh@sysmgr.org"},"maintainers":[{"name":"bahamat","email":""},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"rm","email":"rm@fingolfin.org"}],"dist":{"shasum":"2a7f8066ec3ab40bef28ca384842e75340183bf0","size":6097,"noattachment":false,"key":"/lomstream/-/lomstream-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lomstream/download/lomstream-1.1.0.tgz"},"directories":{},"publish_time":1440094280503,"_hasShrinkwrap":false,"_cnpm_publish_time":1440094280503,"_cnpmcore_publish_time":"2021-12-16T23:06:39.503Z"},"1.0.0":{"name":"lomstream","version":"1.0.0","description":"limit, offset, marker stream","main":"lib/lomstream.js","repository":{"type":"git","url":"git://github.com/joyent/node-lomstream.git"},"dependencies":{"assert-plus":"0.1.5","extsprintf":"1.3.0","vstream":"0.1.0"},"license":"MIT","gitHead":"20920fdb16b01b805d9b8b63b4647d4af837acea","bugs":{"url":"https://github.com/joyent/node-lomstream/issues"},"homepage":"https://github.com/joyent/node-lomstream","_id":"lomstream@1.0.0","scripts":{},"_shasum":"22a453fd2eee89f0c5e59afecc7b6efd24dc4f46","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"rm","email":"rm@fingolfin.org"},"maintainers":[{"name":"bahamat","email":""},{"name":"jclulow","email":"josh@sysmgr.org"},{"name":"rm","email":"rm@fingolfin.org"}],"dist":{"shasum":"22a453fd2eee89f0c5e59afecc7b6efd24dc4f46","size":6049,"noattachment":false,"key":"/lomstream/-/lomstream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lomstream/download/lomstream-1.0.0.tgz"},"directories":{},"publish_time":1438383271714,"_hasShrinkwrap":false,"_cnpm_publish_time":1438383271714,"_cnpmcore_publish_time":"2021-12-16T23:06:39.687Z"}},"readme":"# node-lomstream: Limit, Offset, Marker Stream\n\nThe lomstream is designed to be able to take a paginated resource that\nsupports either a limit and offset, or a limit and a marker, and takes\ncare of streaming, buffering, and fetching through the entire set of\npaginated results. It's been designed, in particular, for use with\n[moray](https://github.com/joyent/moray) and\n[SDC](https://github.com/joyent/sdc) APIs.\n\n## Usage\n\nThe module exports a single function, a LOMStream constructor, which can\nbe used to create a new instance of a LOMStream. The constructor takes the following arguments:\n\n```\n/*\n * Create a limit, offset, marker stream. We require the following options:\n *\n * fetch\tA function that describes how to fetch data. The function will\n * \t\tbe called as fetch(fetcharg, limitObj, datacb, donecb). The\n * \t\tlimitObj will have limit set and one of offset and marker.\n * \t\tThey mean:\n *\n * \t\t\to offset\tThe offset to use for the request\n * \t\t\to marker\tThe marker to use for the request\n * \t\t\to limit\t\tThe limit to use for the request\n *\n * \t\tThe datacb will be of the form datacb(obj). It should be used if\n * \t\tthere's a single object for which data is available. If an error\n * \t\toccurs, then datacb() should not be called any additional times\n * \t\tand instead the donecb should be called with the error.\n *\n * \t\tThe donecb will be of the form of donecb(err, result). The\n * \t\tresult should be an object that has the form of:\n *\n * \t\t\t{\n * \t\t\t\t\"done\": <boolean>\n * \t\t\t\t\"results\": <array>\n *\t\t\t}\n *\n *\t\tThe done boolean indicates that there will be no more results.\n *\t\tThe results array contains an array of items to emit. The type\n *\t\tof the items is not important. The only times that results\n *\t\tshould be empty is when done is set to true or if all entries\n *\t\twere pushed via the datacb(), then results may be empty.\n *\n *\t\tThe two different modes of passing results are designed to\n *\t\thandle two different modes of clients. Using the data callback\n *\t\tfor each item is designed for a fetch() function which streams\n *\t\tresults. Where as the latter form is designed for a fetch() that\n *\t\tbatches results, eg. a rest API request that returns an array of\n *\t\tlimit objects.\n *\n *\n * limit\tThe maximum number of entries to grab at once.\n *\n * We require one of the following:\n *\n * offset\tA boolean set to true to indicate that we should use offsets\n * marker\tA function that given an object returns the marker from it.\n *\n * The following arguments are optional:\n *\n * fetcharg\tAn argument to be passed to the fetching function.\n *\n * streamOptions\tOptions to pass to the stream constructor\n */\n```\n\n## Contributions\n\nContributions welcome, and should be 'make prepush' clean.  The prepush checks\nuse [javascriptlint](https://github.com/davepacheco/javascriptlint) and\n[jsstyle](https://github.com/davepacheco/jsstyle). All tests exit zero\nif succesful. In addition to verifying that the tests still pass, please\nconsider adding any new relevant tests to cover new functionality,\nexposed bugs, or regressions.\n","_attachments":{},"homepage":"https://github.com/joyent/node-lomstream#readme","bugs":{"url":"https://github.com/joyent/node-lomstream/issues"},"license":"MIT"}