Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

graceful-fs 4.2.11

A drop-in replacement for fs, making various improvements.
Package summary
Share
0
issues
1
license
1
ISC
Package created
20 Jul 2011
Version published
16 Mar 2023
Maintainers
1
Total deps
1
Direct deps
0
License
ISC

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
graceful-fs@4.2.11
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
ⓘ This is a list of graceful-fs 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does graceful-fs do?

Graceful-fs is a comprehensive software package designed to function as a drop-in replacement for the fs module, or file system module, found in Node.js. It embodies various enhancements that are aimed to standardize the behavior across different operating systems and environments, as well as increase the resilience to errors in file system access. This includes measures like queuing up 'open' and 'readdir' calls, retrying them once something closes if there's an EMFILE error from too many file descriptors, and implementing fs.lutimes if possible. On Windows, it retries renaming a file for up to one second if the 'EACCESS' or 'EPERM' error occurs. This may be because antivirus software has temporarily locked the directory.

How do you use graceful-fs?

Using Graceful-fs is very straightforward. It can be installed using npm and then used just like you would use the fs module. Here's an example of how you might utilize it:

// Using Graceful-fs  
var fs = require('graceful-fs'); 
// Use it to read a file 
fs.readFile('some-file-or-whatever', (err, data) => {
  // Process the file here.
})

In certain instances, you might want to patch the global fs module. Here's an example of how to handle that:

// Global fs module patching
var realFs = require('fs');
var gracefulFs = require('graceful-fs');
gracefulFs.gracefulify(realFs);

However, it's crucial to remember that patching should only be performed at the top-level application layer to avoid unexpected delays in other parts of the program.

Where are the graceful-fs docs?

The documentation and additional information for Graceful-fs can be found in the README file in the repository on GitHub. It's located at git+https://github.com/isaacs/node-graceful-fs.git. This documentation outlines the specific improvements that Graceful-fs provides over the standard fs module, gives usage examples, details about global patching, and a variety of other pertinent resources and information. Users familiar with fs module can quickly adapt to the use of Graceful-fs, thanks to the comprehensive information and examples provided in the documentation.