Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
fse-promise
Advanced tools
Promisified version of Node fs and fs-extra that preserves callbacks.
npm install fse-promise
Drop-in replacement for Node fs and fs-extra module.
All Node fs
and fs-extra
asynchronous methods are wrapped so that
they return a promise if callback is not provided.
If callback is defined then the method works as defined in fs
and
fs-extra
.
Check index.js
for list of supported methods.
If you notice any missing methods in that list, add it and create PR to get it added.
Example usage:
const fs = require('fse-promise');
// using callbacks
fs.readFile(filepath, (err, data) => {
if (err) return console.error(err);
console.log(data);
fs.outputFile(filepath, (err, data => {
if (err) return console.error(err);
console.log('saved');
}));
});
// using promises
fs.readFile(filepath)
.then((data) => {
console.log(data);
return fs.outputFile(filepath);
})
.then(() => {
console.log('saved');
})
.catch((err) => {
console.error(err);
});
FAQs
Promisefied version of fs-extra and fs that preserves callbacks
The npm package fse-promise receives a total of 7 weekly downloads. As such, fse-promise popularity was classified as not popular.
We found that fse-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.