Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
fs-wishlist
Advanced tools
Mixins for the Node.JS file system adding the functionality we wish it had.
Mixins for the Node.JS file system adding the functionality we wish it had.
Mixin an implementation of the file system interface.
Object
Optional enables/disables mixins
Boolean
Optional Default: true
Controls whether fs.mkdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.rmdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.readdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.copyDir(sourcePath, destinationPath[, callback])) is mixed in.var fsWishlist = require('fs-wishlist');
var fs = require('fs');
var xfs = fsWishlist.mixin(fs);
xfs.mkdirp('test/subdirectory/a').then(function() {
// Test directories created recursively
}, function(reason) {
// Something went wrong
});
Replace the fs
module with an already mixed in vesion of fs
.
Object
Optional enables/disables mixins
Boolean
Optional Default: true
Controls whether fs.mkdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.rmdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.readdirp(path[, callback])) is mixed in.Boolean
Optional Default: true
Controls whether fs.copyDir(sourcePath, destinationPath[, callback])) is mixed in.require('fs-wishlist').replace();
var fs = require('fs');
fs.readdirp('test').then(function(files) {
// Files contains all files in the `test` directory
}, function(reason) {
// Something went wrong
});
For all methods callbacks are optional, if provided they will be used otherwise a promise will be returned.
Recursively create directories if they don't exist.
var xfs = require('fs-wishlist').replace();
xfs.mkdirp('/one/two/three').then(function() {
// Directories created
}, function(reason) {
// Something went wrong!
});
Recursively removes the given directory.
var xfs = require('fs-wishlist').replace();
xfs.rmdirp('/one').then(function() {
// All directories and files removed from `/one` and below
}, function(reason) {
// Something went wrong!
});
Recursively reads the given directory.
var xfs = require('fs-wishlist').replace();
xfs.readdirp('/one').then(function(files) {
// `files` contains a list of all files and directories in `/one` recursively
}, function(reason) {
// Something went wrong!
});
Recursively copies the contents of a directory to the destination, creates the destination directories if they do not exist. This overwrites the files if they already exist, and directories themselves are not copied but instead a new directory is created of the same name.
var xfs = require('fs-wishlist').replace();
xfs.copyDir('/one', '/two').then(function() {
// All of the same directories created in the destination and the files are copied recursively
}, function(reason) {
// Something went wrong!
});
FAQs
Mixins for the Node.JS file system adding the functionality we wish it had.
We found that fs-wishlist 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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.