Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-chunk

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-chunk

Read a chunk from a file

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
613K
decreased by-1.69%
Maintainers
0
Weekly downloads
 
Created

What is read-chunk?

The 'read-chunk' npm package allows you to read a specific chunk of a file. This can be useful for tasks such as file type detection, partial file processing, and more.

What are read-chunk's main functionalities?

Read a specific chunk of a file

This feature allows you to read a specific chunk of a file. In this example, it reads the first 10 bytes from 'example.txt' and logs it to the console.

const readChunk = require('read-chunk');
const buffer = readChunk.sync('example.txt', 0, 10);
console.log(buffer.toString());

Asynchronous chunk reading

This feature allows you to read a specific chunk of a file asynchronously. In this example, it reads the first 10 bytes from 'example.txt' and logs it to the console.

const readChunk = require('read-chunk');
readChunk('example.txt', 0, 10).then(buffer => {
  console.log(buffer.toString());
}).catch(err => {
  console.error(err);
});

Other packages similar to read-chunk

Keywords

FAQs

Package last updated on 28 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc