HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/farhangmoaser/web/node_modules/read-chunk/index.d.ts
export type Options = {
	/**
	The number of bytes to read.
	*/
	readonly length: number;

	/**
	The position to start reading from.

	@default 0
	*/
	readonly startPosition?: number | bigint;
};

/**
Read a chunk from a file asyncronously.

@param filePath - The path to the file.
@returns The read chunk.

@example
```
import {readChunk} from 'read-chunk';

// foo.txt => hello

await readChunk('foo.txt', {length: 3, startPosition: 1});
//=> 'ell'
```
*/
export function readChunk(filePath: string, options: Options): Promise<Uint8Array>;

/**
Read a chunk from a file synchronously.

@param filePath - The path to the file.
@returns The read chunk.

@example
```
import {readChunkSync} from 'read-chunk';

// foo.txt => hello

readChunkSync('foo.txt', {length: 3, startPosition: 1});
//=> 'ell'
```
*/
export function readChunkSync(filePath: string, options: Options): Uint8Array;