Gathering detailed insights and metrics for safefs
Gathering detailed insights and metrics for safefs
Gathering detailed insights and metrics for safefs
Gathering detailed insights and metrics for safefs
Deprecated. Use the @bevry/fs-* packages instead
npm install safefs
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.7
Supply Chain
100
Quality
76.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
77,341,970
Last Day
6,801
Last Week
122,938
Last Month
525,504
Last Year
6,634,305
NOASSERTION License
7 Stars
266 Commits
3 Forks
1 Watchers
2 Branches
5 Contributors
Updated on Jan 03, 2024
Minified
Minified + Gzipped
Latest Version
8.10.0
Package Id
safefs@8.10.0
Unpacked Size
35.99 kB
Size
10.66 kB
File Count
6
NPM Version
10.2.3
Node Version
20.10.0
Published on
Jan 02, 2024
Cumulative downloads
Total Downloads
Last Day
1.5%
6,801
Compared to previous day
Last Week
-2.4%
122,938
Compared to previous week
Last Month
-5.6%
525,504
Compared to previous month
Last Year
4.3%
6,634,305
Compared to previous year
Stop getting EMFILE errors! Open only as many files as the operating system supports.
1var safefs = require('safefs')
SafeFS uses graceful-fs to wrap all of the standard file system methods to avoid EMFILE errors among other problems.
On-top of graceful-fs, SafeFS also adds additional wrapping on the following methods:
writeFile(path, data, options?, next)
- ensure the full path exists before writing to itappendFile(path, data, options?, next)
- ensure the full path exists before writing to itmkdir(path, mode?, next)
- mode defaults to 0o777 & (~process.umask())
unlink(path, next)
- checks if the file exists before removing itSafeFS also define these additional methods:
ensurePath(path, options, next)
- ensure the full path exists, equivalent to unix's mdir -p path
getParentPathSync(path)
- returns the parent directory of the pathYou should use these instead, which use and provide modern APIs while providing brilliant ecosystem support:
npm install --save safefs
import * as pkg from ('safefs')
const pkg = require('safefs')
This package is published with the following editions:
safefs
aliases safefs/source/index.js
safefs/source/index.js
is ESNext source code for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesThis project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth
compiler option to 5
or thereabouts. You can accomplish this via your tsconfig.json
file like so:
1{ 2 "compilerOptions": { 3 "maxNodeModuleJsDepth": 5 4 } 5}
Discover the release history by heading on over to the HISTORY.md
file.
Discover how to contribute via the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More