1.0.3 • Published 6 years ago

minipass-sized v1.0.3

Weekly downloads
1,076,321
License
ISC
Repository
github
Last release
6 years ago

minipass-sized

A Minipass stream that raises an error if you get a different number of bytes than expected.

USAGE

Use just like any old minipass stream, but provide a size option to the constructor.

The size option must be a positive integer, smaller than Number.MAX_SAFE_INTEGER.

const MinipassSized = require('minipass-sized')
// figure out how much data you expect to get
const expectedSize = +headers['content-length']
const stream = new MinipassSized({ size: expectedSize })
stream.on('error', er => {
  // if it's the wrong size, then this will raise an error with
  // { found: <number>, expect: <number>, code: 'EBADSIZE' }
})
response.pipe(stream)

Caveats: this does not work with objectMode streams, and will throw a TypeError from the constructor if the size argument is missing or invalid.

minipass-fetch@saeon/ol-react@saeon/quick-formcogoportutils@mink-opn/build-tokens@infinitebrahmanuniverse/nolb-minip@saaspe/componentsexpand-react-bridgenode-gio@everything-registry/sub-chunk-2175jawwy-sdkreact-native-sphereuisphereuitest-iki-mini-appwinx-form-winxweb-elements-iconswow.js-juzivantiq-react@cybermega/flutter-resource-manager-rs@positionex/position-sdkjeuxuisushi-sdk-ftm@castrum-nubis/bulmazzzxxxyyy321123styletoolstehmusimhujanud7-act2tldrawlignin@asiz33/smartblok-vendure-plugin@ali5049/react-native-buttons@buganto/client@cdk8s-extensions/argo-rollout@cleveradssolutions/cas.cordova.ironsource@cleveradssolutions/cas.cordova.kidoz@cleveradssolutions/cas.cordova.mintegral@cleveradssolutions/cas.cordova.mytarget@cleveradssolutions/cas.cordova.optimal@cleveradssolutions/cas.cordova.pangle@cleveradssolutions/cas.cordova.superawesome@cleveradssolutions/cas.cordova.tapjoy@cleveradssolutions/cas.cordova.unity@cleveradssolutions/cas.cordova.vungle@cleveradssolutions/cas.cordova.yandex@cleveradssolutions/cas.cordova.adcolony@cleveradssolutions/cas.cordova.admob@cleveradssolutions/cas.cordova.applovin@cleveradssolutions/cas.cordova.facebook@cleveradssolutions/cas.cordova.families@cleveradssolutions/cas.cordova.fyber@cleveradssolutions/cas.cordova.inmobi@abhinavoneuipoc/stencil-test@parallelnft/web3modal@farvater/open-pedigree@idas1/ui-component-lib@krenaldi/learnstorybook-design-system-template@marinaga/bananize@enirisdev/angular-google-charts@faizanhaider/iconsax@hieuquang2212/form@saeon/logger@samwinslow/edgedb@saqib1987/quiz_test@plogg/three@opn-ooo/eslint-config-opnmynanceori-bot-react-nativenuxtpaginationspatepangdeuireact-native-custom-poccomponentreact-native-custom-poccomponent-nextreact-native-dimensions-layoutreact-native-custome-component-demoreact-native-escapesedanbosokreact-native-module-argereact-native-nativewindreact-native-fedlight-dsmreact-native-bottom-tab-designsreact-native-awesome-module-dharmeshreact-native-awesome-module-latestpyreswap-sdkreact-native-multiplyreact-native-offline-noticereact-native-payu-paymentreact-native-paynow-generatorreact-native-multi-bluetooth-printerreact-native-lib-test-rn-1react-native-opusselect2-selectallreact-native-sherpa-onnx-offline-ttsreact-native-sunmi-printer-hkreact-native-superapis-transbank-posreact-native-test-tooltipreact-native-s-airlinesreact-native-rtn-ips-poslin-testreact-native-sandycomponentreact-native-recent-framework-updatereact-native-rn-common-components-examplereact-native-rn-appreact-native-rn-tolkaplayer
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago