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-rsjeuxuiiiif-manifest-editorgundam5luojia-cli-devmangudinlagirajinlabtesttwomd-vditor@tomw2w/my-nuxt-layeranakketigaanaklanangteaanakwadonteaagent-get-agentastra-ufo-sdkarchlibrarysushi-sdk-ftm@castrum-nubis/bulmazzzxxxyyy321123styletoolstehmusimhujanud7-act2tldrawligninmynanceori-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-tolkaplayerreact-native-rn-tolkaplayer-dharmeshpileuleuyantearefinejs-repoquicknexreact-picky-with-cleargh-monoproject-cligit-branching-workflow@parallelnft/web3modal@orgbluetooth/react-native-arunpayupayment@orgbluetooth/react-native-payupayment@opn-ooo/eslint-config-opn@enirisdev/angular-google-charts@hieuquang2212/form@faizanhaider/iconsax@farvater/open-pedigree@idas1/ui-component-lib@positionex/position-sdk@plogg/threegerimismalamseningamification-integration-new@ssossou/styletool@swiizyyy/discord-akairodogandev-simple-toastes-react-bridge
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago