Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
fs-mkdirp-stream
Advanced tools
Readme
Ensure directories exist before writing to them.
var { Readable, Writable } = require('streamx');
var mkdirpStream = require('fs-mkdirp-stream');
Readable.from([{ dirname: './path/to/my/', path: './path/to/my/file.js' }])
.pipe(
mkdirpStream(function (obj, callback) {
// callback can take 3 arguments (err, dirname, mode)
callback(null, obj.dirname);
})
)
.pipe(
new Writable({
write: function (obj, cb) {
// This will be called once the directory exists
// obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' }
cb();
},
})
);
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.
FAQs
Unknown package
The npm package fs-mkdirp-stream receives a total of 1,316,514 weekly downloads. As such, fs-mkdirp-stream popularity was classified as popular.
We found that fs-mkdirp-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.