Gathering detailed insights and metrics for fs-mkdirp-stream
Gathering detailed insights and metrics for fs-mkdirp-stream
Gathering detailed insights and metrics for fs-mkdirp-stream
Gathering detailed insights and metrics for fs-mkdirp-stream
npm install fs-mkdirp-stream
98.1
Supply Chain
86.1
Quality
77.5
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
8 Stars
24 Commits
7 Forks
6 Watching
1 Branches
5 Contributors
Updated on 05 Nov 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5.3%
381,224
Compared to previous day
Last week
4.8%
2,068,395
Compared to previous week
Last month
19.3%
8,163,838
Compared to previous month
Last year
13.2%
87,337,256
Compared to previous year
2
Ensure directories exist before writing to them.
1var { Readable, Writable } = require('streamx'); 2var mkdirpStream = require('fs-mkdirp-stream'); 3 4Readable.from([{ dirname: './path/to/my/', path: './path/to/my/file.js' }]) 5 .pipe( 6 mkdirpStream(function (obj, callback) { 7 // callback can take 3 arguments (err, dirname, mode) 8 callback(null, obj.dirname); 9 }) 10 ) 11 .pipe( 12 new Writable({ 13 write: function (obj, cb) { 14 // This will be called once the directory exists 15 // obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' } 16 cb(); 17 }, 18 }) 19 );
mkdirpStream(resolver)
Takes a resolver
function or string and returns a streamx.Transform
stream.
If the resolver
is a function, it will be called once per chunk with the signature (chunk, callback)
. The callback(error, dirpath, mode)
must be called with the dirpath
to be created as the 2nd parameter or an error
as the 1st parameter; optionally with a mode
as the 3rd parameter.
If the resolver
is a string, it will be created/ensured for each chunk (e.g. if it were deleted between chunks, it would be recreated). When using a string, a custom mode
can't be used.
MIT
Contains a custom implementation of mkdirp
originally based on https://github.com/substack/node-mkdirp (Licensed MIT/X11 - Copyright 2010 James Halliday) with heavy modification to better support custom modes.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 1/22 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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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 2024-11-18
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