
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@dropb/diskinfo
Advanced tools
Disk usage info on both *nix (via
df
) and Windows (viaWMIC
) systems
npm install @dropb/diskinfo
// JS example (Windows)
const { diskinfo } = require('@dropb/diskinfo');
diskinfo()
.then(result => console.log(result))
.catch(err => console.error(err.message));
/* OUTPUT:
[{
fstype: '3',
size: 185429127168,
used: 51971362816,
avail: 133457764352,
pcent: '29%',
target: 'C:'
},
{
fstype: '2',
size: 16046358528,
used: 4434288640,
avail: 11612069888,
pcent: '28%',
target: 'F:'
},
{
fstype: '4',
size: 107569381376,
used: 106081509376,
avail: 1487872000,
pcent: '99%',
target: 'V:'
}]
*/
// Typescript example (Ubuntu)
import { diskinfo, DiskInfo } from '@dropb/diskinfo';
async function run() {
const result: DiskInfo = await diskinfo('./');
console.log(result);
}
run();
/* OUTPUT:
{ fstype: '/dev/sda1',
size: 47242534912,
used: 21033943040,
avail: 23785177088,
pcent: '47%',
target: '/' }
*/
/**
* @param file - get info of the filesystem containing the specified file or directory
* @returns promise for an object with the info for the specified file or directory
*/
function diskinfo(file: string): Promise<DiskInfo>;
/**
* @returns promise for an array with the info for all mounted filesystem
*/
function diskinfo(): Promise<DiskInfo[]>;
/**
* Info of the filesystem
*/
interface DiskInfo {
/**
* POSIX - File system type
*
* Win32 - Win32_LogicalDisk DriveType(as `String`!):
* - "0": Unknown
* - "1": No Root Directory
* - "2": Removable Disk
* - "3": Local Disk
* - "4": Network Drive
* - "5": Compact Disc
* - "6": RAM Disk
*/
fstype: string;
/**
* Total size in bytes
*/
size: number;
/**
* Used size in bytes
*/
used: number;
/**
* Available size in bytes
*/
avail: number;
/**
* Percentage of used divided by size
*/
pcent: string;
/**
* Mount point
*/
target: string;
}
FAQs
Get disk usage info
We found that @dropb/diskinfo 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
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.