{"_id":"size-limit-stream","_rev":"3-32a1e9c04af07001b0b684f891b4f5ff","name":"size-limit-stream","description":"a through stream that destroys itself if an overall size limit for the combined stream throughput is exceeded","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"size-limit-stream","version":"1.0.0","description":"a through stream that destroys itself if an overall size limit for the combined stream throughput is exceeded","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/size-limit-stream.git"},"keywords":["stream","streams2","through2"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/size-limit-stream/issues"},"homepage":"https://github.com/maxogden/size-limit-stream","dependencies":{"through2":"^0.6.3"},"devDependencies":{"standard":"^3.3.0","tape":"^3.5.0"},"gitHead":"720d38e76d6ebdbe5b3a4ed4c48d6db49210219e","_id":"size-limit-stream@1.0.0","_shasum":"1ec24bad01550e8855ee29bf036bed8e9ee05dc3","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"1ec24bad01550e8855ee29bf036bed8e9ee05dc3","tarball":"https://registry.npmjs.org/size-limit-stream/-/size-limit-stream-1.0.0.tgz","integrity":"sha512-0AwxeHEpOLhnRxNl6efPOuQ2HFGBY9iJ8CLPsqIp9TxA6S53gx9finl2f3Mbzg5MfzqTbjqu3wi+BSHnD2yIAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDNO0Xl5H/kT4RC5nPFiloWhQsfMvAx3H9vEpqUJEHKgIgfFT8UERy2/EM9j3S5Me2rmfo2yAoEs77VPZ7CtixSB0="}]}}},"readme":"# size-limit-stream\n\n[![NPM](https://nodei.co/npm/size-limit-stream.png)](https://nodei.co/npm/size-limit-stream/)\n\n[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard)\n\n[![Build Status](https://travis-ci.org/maxogden/size-limit-stream.svg?branch=master)](https://travis-ci.org/maxogden/size-limit-stream)\n\na through stream that destroys itself if an overall size limit for the combined stream throughput is exceeded. useful for e.g. limiting HTTP upload size\n\n## usage\n\n### `limitStream(limit)`\n\nreturns a through stream\n\nexample:\n\n```js\nvar limiter = limitStream(1024 * 5) // 5kb max\n```\n\n## example\n\ncreate a stream that concatenates input, but only if input is less than the limit:\n\n```\nvar pumpify = require('pumpify')\nvar concat = require('concat-stream')\nvar limitStream = require('size-limit-stream')\n\nfunction uploadStream (cb) {\n  var limiter = limitStream(1024 * 5) // 5kb max\n  var concatter = concat(function concatted (buff) {\n    cb(null, buff)\n  })\n\n  var combined = pumpify(limiter, concatter)\n  combined.on('error', cb)\n  \n  return combined\n}\n```\n","maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"time":{"modified":"2022-06-26T20:26:42.147Z","created":"2015-03-27T18:43:09.395Z","1.0.0":"2015-03-27T18:43:09.395Z"},"homepage":"https://github.com/maxogden/size-limit-stream","keywords":["stream","streams2","through2"],"repository":{"type":"git","url":"https://github.com/maxogden/size-limit-stream.git"},"author":{"name":"max ogden"},"bugs":{"url":"https://github.com/maxogden/size-limit-stream/issues"},"license":"BSD","readmeFilename":"readme.md"}