5.0.0 • Published 10 months ago

read-chunk v5.0.0

Weekly downloads
1,085,323
License
MIT
Repository
github
Last release
10 months ago

read-chunk

Read a chunk from a file

Because the built-in way requires way too much boilerplate.

Install

npm install read-chunk

Usage

import {readChunk} from 'read-chunk';

// foo.txt => hello

await readChunk('foo.txt', {length: 3, startPosition: 1});
//=> 'ell'

API

readChunk(filePath, {length, startPosition})

Returns a Promise<Uint8Array> with the read chunk.

readChunkSync(filePath, {length, startPosition})

Returns a Uint8Array with the read chunk.

filePath

Type: string

length

Type: number

The number of bytes to read.

startPosition

Type: number

The position to start reading from.

gatsby-source-filesystem-frontmatterskdjfjlskdfjimage-grayscaletoda-google-apivuln-func-validator@jon.sypht/sypht-node-cliententrance-serviceyouzanyun_hknode-red-contrib-vdoogatsby-woocommerce-elementor-theme@ligadigital/image-resizerrugo-filesystemrugo-mongodbcroket_main@infinitebrahmanuniverse/nolb-read-@webcatalog/moleculemyfiteco-api@everything-registry/sub-chunk-2628@xspada/image-validatortauritcappsypht-node-clientsystem-font-familiessystem-font-families_skyweapp-server-sdkwp-toolswrenderwx-voiceteapackage-tatespoorman297spotlight-cache-saverthe-file-utilthird-wafer-node-sdkvalence-nativevalidate-image-type@divisey/js-mdict@crazyfactory/webp-converter-cli@crazyfactory/jpeg-compression-cli@crazyfactory/png-compression-cli@cs125/gatsby-source-filesystem-frontmatter@curatedlists/cli@blinkmobile/aws-s3jimp-minjimp2jpeg-chankanrojz-jimpjinghuan-middleware-resourceis-fontjay-nedbio.maana.sharedis-progressivekm7@robvanderleek/backpackbuzz-expertsortrsoundlysologenic-nft-mintersologenic-nft-sdkud7-act2theloungethelounge-snthink_uploadtmake-filetreenotetogglyzertosec-toolusergrid@appveen/utils@appveen/xcro-utils@aptuitiv/website-build-tools@avocode/system-font-families@bablr/macrome@azteam/google-api@agneta/portal@agc93/pak-reader@ahm-monash/private-test@broid/utils@bwagener/gridsome-source-google-docs@c8/simple-promised-file@chiaraani/bouncing-ball@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@acto/gatsby-source-filesystem@cojad/bottender
5.0.0

10 months ago

4.0.3

3 years ago

4.0.1

4 years ago

4.0.2

4 years ago

4.0.0

4 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

7 years ago

2.1.0

8 years ago

2.0.0

9 years ago

1.0.1

10 years ago

1.0.0

11 years ago

0.1.0

11 years ago