Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple disk space checker module. Check out the GitHub page for more details.
This is a simple module for Node.js to check disk space usage in bytes on both *nix and Windows systems.
If you are using on Windows, This also depends on a console application for Windows called DriveSpace written in C# and requires .NET Framework 3.5 when using this on a Windows system. This is included in the NPM package, but you can look at the DriveSpace code also if you wish.
If your on a *nix system, drivespace.exe
is not used and df
command is used.
To set up diskspace.js on your Node.js server use npm.
npm install diskspace
var diskspace = require('diskspace');
diskspace.check('C', function (err, result)
{
Your code here
});
On Windows you change C to the drive letter you want to check. On Linux you use the mount path eg /
.
The result of the diskspace check is returned as an object named result
.
result.total
is how much the drive has totally.result.used
is how much of the drive is reported as used. On *nix this is straight from the df -k
command, on Windows it's calculated from result.total - result.free
result.free
is how much free space you have.result.status
isn't really that useful unless you want to debug.This will fail on hard drives bigger than 9 petabytes. Thanks @SteveStreza [1] [2]
FAQs
A simple disk space checker module. Check out the GitHub page for more details.
The npm package diskspace receives a total of 7,248 weekly downloads. As such, diskspace popularity was classified as popular.
We found that diskspace 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.