1.2.0 • Published 7 years ago

buffer-alloc v1.2.0

Weekly downloads
8,541,356
License
MIT
Repository
github
Last release
7 years ago

Buffer Alloc

A ponyfill for Buffer.alloc.

Works as Node.js: v7.0.0 Works on Node.js: v0.10.0

Installation

npm install --save buffer-alloc

Usage

const alloc = require('buffer-alloc')

console.log(alloc(4))
//=> <Buffer 00 00 00 00>

console.log(alloc(6, 0x41))
//=> <Buffer 41 41 41 41 41 41>

console.log(alloc(10, 'linus', 'utf8'))
//=> <Buffer 6c 69 6e 75 73 6c 69 6e 75 73>

API

alloc(size[, fill, encoding])

  • size <Integer> The desired length of the new Buffer
  • fill <String> | <Buffer> | <Integer> A value to pre-fill the new Buffer with. Default: 0
  • encoding <String> If fill is a string, this is its encoding. Default: 'utf8'

Allocates a new Buffer of size bytes. If fill is undefined, the Buffer will be zero-filled.

See also

@arisageha/react-lazyload@cashremit/cr-streamline-iconsspeaker-private-no-maintainence-shrugcloud-archive-s3rn-pdf-reader-offlinedyx-reacttalent-to-vite-clireact-native-slider-kfunblock-block-save-variables@infinitebrahmanuniverse/nolb-buf@everything-registry/sub-chunk-1271web-elements-iconsvue-infinite-loading-propsspeaker-private-no-maintainence-shrug2speakerspeaker-arm64test-public-protether-passwordvorbisutpvideo-multi-uploadervue-dev-clone@dosy/wav@cspotcode/speakercauseway-concrete-stylesjeuxuijesh-calculationka-flow.jstmi-speakerto-icoto-ico-resize-img-v2@alyxsqrd/poppinss-utils@aviinash_jha/react-native-test_multiply@aleclarson/isbinaryfile@aleen42/csv-parser@carllewi2/sapcdc-ally-driver@cdevine49/react-numeric-input@chainsafe/snappy-stream@davids-devel/rocket-translatoryangzai-cliyf-sw-cliwcq-vuewav-headerswav-memfswavzeronode@edwinpb/scany@labiebhn_/react-native-multiplier@litedexdev/litedex-core-swap@nandhakumarb/npm_sample@faizanhaider/iconsax@dxos/random-access-storage@meemproject/react@igniswap/igni-swap-lib@inesfidalgo/forge@npm-lt/cli@seculum/vue-dev-clonemy-temp-climicro-sub-clipeer-wire-protocolsciadvfilesreact-native-adarsh_react_native_video_playerreact-native-avinash_jha_test_pluginreact-native-moosa-lib-for-testsafe-comparereact-native-test-multiplier-librarynew-speakerng-search-dropdownnove-repositorypixiu-swap-corepixiuswap-libs-sdkrandom-access-idbrebirth-wavreact-native-sharing-intentsnappy-streamhomebridge-video-doorbell-buttonlfd-speakerlibp2p-in-browsermanan-react-native-expo-authorize-net@thismr/bitmindtest-core@yujohnnattrass/speaker-no-underflow-logs@tap-ogg/vorbisadonis-ally-figmaaudiosprite-pkgaxios-yet-another-proxy-fixappdmg-exokitcblink-clicotrader-dex-sdkconvert-imgdiscordjs-con-selfdiscord.js-bycondrift-npmeyeq-csv-parseretheral-clifenglin-uploadergeoip-lite-buffer-polyfill
1.2.0

7 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago