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

read-big-file

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-big-file

Reads gigantic files

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

read-big-file

The Problem:

fs.readFile and fs.readFileSync cannot handle files larger than a couple dozen megabytes.

The Solution:

Readstreams can handle much, much larger amounts of data, and I found myself writing the same bit of code over and over, so I decided to put it in its own package.

Usage

const readBigFile = require('read-big-file');
readBigFile('./bigFile').then((contents) => {
  // Do Something
}).catch((err) => {
  // An error occurred
});

readBigFile accepts three arguments:

  • path - The path to the file
  • json (optional) - If true, readBigFile will safely try to decode a JSON object from the file (defaults to false)
  • encoding (optional) - The encoding of the file (defaults to 'utf-8')

FAQs

Package last updated on 18 Jul 2017

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