Gathering detailed insights and metrics for @extra-fs/promises
Gathering detailed insights and metrics for @extra-fs/promises
Gathering detailed insights and metrics for @extra-fs/promises
Gathering detailed insights and metrics for @extra-fs/promises
npm install @extra-fs/promises
Typescript
Module System
Node Version
NPM Version
68.6
Supply Chain
99.3
Quality
76.2
Maintenance
100
Vulnerability
100
License
TypeScript (93.12%)
JavaScript (6.88%)
Total Downloads
11,862
Last Day
1
Last Week
30
Last Month
109
Last Year
1,481
100 Commits
3 Watching
2 Branches
1 Contributors
Latest Version
3.1.4
Package Id
@extra-fs/promises@3.1.4
Unpacked Size
19.24 kB
Size
5.21 kB
File Count
6
NPM Version
8.11.0
Node Version
17.9.1
Cumulative downloads
Total Downloads
Last day
-50%
1
Compared to previous day
Last week
15.4%
30
Compared to previous week
Last month
0.9%
109
Compared to previous month
Last year
-42.5%
1,481
Compared to previous year
Useful additions to inbuilt fs module{promises} .
📦 Node.js,
📜 Files,
📰 Docs.
This package provides async versions of functions (in addition to the
existing sync and callback-based functions) in the inbuilt fs module,
exposed as *Async()
from the fs.promises
namespace. They can be used with
Promise
-based asynchronous programming using the await
keyword. In addition,
callback-based functions, such as readFile, also behave as async functions
when a callback is not provided. The idea behind using *Async()
function
names is to provide a flat module.
In addition, convenience functions such as readFileText and readJson are
included. For performing file/directory existence check async exists,
assertExists, and assertNotExists can be used. Cleanup of one-item outer
directories can be performed with dehuskdir. This package previously included
which()
, which is now instead suitably included in extra-child-process
package.
Stability: Experimental.
1const fs = require('extra-fs'); 2 3 4// 1. Read file text. 5async function example1() { 6 var text = fs.readFileTextSync('.npmignore'); 7 var text = await fs.readFileText('.npmignore'); 8 // → # Source only 9 // → .gitmodules 10 // → .github/ 11 // → .docs/ 12 // → ... 13} 14example1(); 15 16 17// 2. Read JSON file. 18async function example2() { 19 var json = fs.readJsonSync('package.json'); 20 var json = await fs.readJson('package.json'); 21 // → { 22 // → name: 'extra-fs', 23 // → version: '3.0.27', 24 // → description: 'Useful additions to inbuilt fs module.', 25 // → ... 26 // → } 27} 28example2(); 29 30 31// 3. Assert that a file exists. 32async function example3() { 33 if (!(await fs.exists('LICENSE'))) throw 'May I see you license sir?'; 34 await fs.assertExists('LICENSE'); 35} 36example3(); 37 38 39// 4. Get contents of a directory. 40async function example4() { 41 var contents = fs.readdirSync('src'); 42 var contents = await fs.readdir('src'); 43 // → [ 44 // → 'index.ts', 45 // → 'promises.ts', 46 // → '_all.ts', 47 // → ... 48 // → ] 49} 50example4();
Property | Description |
---|---|
open | Open a file. |
close | Close a file. |
read | Read data from a file. |
write | Write data to a file. |
readv | Read an array of buffers from file. |
writev | Write an array of buffers to file. |
ftruncate | Shorten (truncate) a file. |
futimes | Change the file system timestamps of a file. |
fstat | Get information about a file. |
fchmod | Set the permissions of a file. |
fchown | Set the owner of a file. |
... | |
link | Create a hard link to a file or directory. |
symlink | Create a symbolic link to a file or directory. |
readlink | Read the contents of a symbolic link. |
realpath | Get canonical pathname by resolving ., .. |
lutimes | Change the file system timestamps of an object. |
lstat | Get information about a file, without dereferencing symbolic links. |
lchown | Set the owner of a symbolic link. |
... | |
readFile | Read the entire contents of a file. |
writeFile | Write data to the file, replace if it already exists. |
appendFile | Append data to a file, create if it does not exist. |
truncate | Shorten (truncate) a file. |
unlink | Remove a file or symbolic link. |
utimes | Change the file system timestamps of an object. |
stat | Get file status. |
copyFile | Copy source file to destination, overwite if exists. |
readFileText | Read file text with Unix EOL. |
writeFileText | Write file text with system EOL. |
readJson | Read JSON file as value. |
writeJson | Write object to JSON file. |
watchFile | Watch for changes on filename . |
unwatchFile | Stop watching for changes on filename . |
watch | Watch for changes on filename , where filename is either a file or a directory. |
createReadStream | Create a readable stream with 64kb highWaterMark . |
createWriteStream | Create a writeable stream from a desired start position. |
... | |
mkdir | Create a directory. |
mkdtemp | Create a unique temporary directory. |
opendir | Open a directory. |
readdir | Open a directory. |
rmdir | Remove a directory. |
dehuskdir | Remove outer one-item directories. |
... | |
access | Test a user's permissions for the file or directory. |
chmod | Change the permissions of a file. |
chown | Change owner and group of a file. |
rename | Rename/move a file or directory. |
cp | Copy source directory to destination, overwite if exists. |
rm | Remove a file or directory. |
exists | Check if file or directory exists. |
assertExists | Assert that a file or directory exists. |
assertNotExists | Assert that a file or directory does not exist. |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-12-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