node-drivelist
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

node-drivelist

Inspired by diskusage-ng

node-drivelist-ts provides all hard used disks with disk allocation and mount point.

The project is written in Typescript and does not need node-gyp.

Windows & Linux are supported

Usage

import { getDriveList } from "node-drivelist";
//...
const drives = await getDriveList();

console.log(drives);
/**
 Output
	Linux:
	  [{
	    total: 100663296,
	    used: 31685632,
	    available: 68977664,
	    percentageUsed: 32,
	    mountpoint: '/boot/efi',
	    name: 'efi'
	  }]
	Windows:
		[{
	    total: 100663296,
	    used: 31685632,
	    available: 68977664,
	    percentageUsed: 32,
	    mountpoint: 'E:',
	    name: 'BackupDisk'
	  }]
**/
const drive = await getDriveByName('efi');
console.log(drive);
/**
  Output
  {
    total: 100663296,
    used: 31685632,
    available: 68977664,
    percentageUsed: 32,
    mountpoint: '/boot/efi',
    name: 'efi'
  }
**/

Package Sidebar

Install

npm i node-drivelist

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

11.3 kB

Total Files

11

Last publish

Collaborators

  • drainerlight