New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@nishin/node-file-reader

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nishin/node-file-reader

Read various data types from a Node.JS file handle in a streamlined way

latest
Source
npmnpm
Version
0.8.0
Version published
Maintainers
0
Created
Source

Asynchronous binary reader for Node.JS

Read various data types from a file handle in a streamlined way

NPM Version

The NodeFileReader class implements file handle access on top of the AsyncReader class and is suitable to read very large files as the file is only partially loaded into memory while traversing it. The API layer is almost identical to the BinaryReader class, only that most methods return promises instead.

For details on supported data types consult the @nishin/reader readme.

Usage

import fs from 'node:fs/promises';

import { NodeFileReader, DataType } from '@nishin/node-file-reader';

const reader = new NodeFileReader(await fs.open('/path/to/large/file'), ByteOrder.BigEndian, { bufferSize: 8192 });

const data = await reader.next(DataType.Uint8);

await reader.close();

Keywords

binary

FAQs

Package last updated on 06 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts