Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Stop getting EMFILE errors! Open only as many files as the operating system supports.
Stop getting EMFILE errors! Open only as many files as the operating system supports.
require('safefs')
npm install --save safefs
require('safefs')
ender add safefs
var safefs = require('safefs');
The following file system methods are available (but wrapped in safe way to prevent EMFILE errors):
readFile(path, options?, next)
writeFile(path, data, options?, next)
- will also attempt to ensure the path existsappendFile(path, data, options?, next)
- will also attempt to ensure the path existsmkdir(path, mode?, next)
- mode defaults to 0o777 & (~process.umask())
stat(path, next)
readdir(path, next)
unlink(path, next)
rmdir(path, next)
exists(path, next)
For other file system interaction, you can do the following:
// get a slot in the file system queue
require('safefs').openFile(function(closeFile){
// do our file system interaction
require('fs').someOtherMethod(a,b,c,function(err,a,b,c){
// close the slot we are using in the file system queue
closeFile();
});
});
To make this possible we define a global variable called safefsGlobal
that manages the available slots for interacting with the file system.
Discover the change history by heading on over to the History.md
file.
Discover how you can contribute by heading on over to the Contributing.md
file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Licensed under the incredibly permissive MIT license
Copyright © 2013+ Bevry Pty Ltd us@bevry.me (http://bevry.me)
Copyright © 2011-2012 Benjamin Lupton b@lupton.cc (http://balupton.com)
v3.0.4 2013 November 6
FAQs
Stop getting EMFILE errors! Open only as many files as the operating system supports.
The npm package safefs receives a total of 0 weekly downloads. As such, safefs popularity was classified as not popular.
We found that safefs demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.