@hyperplay/check-disk-space
TypeScript icon, indicating that this package has built-in type declarations

3.5.2 • Public • Published

Check disk space

Continue Integration check-disk-space on npm License MIT

Introduction

Light multi-platform disk space checker without third party for Node.js.

  • Works on Linux, macOS and Windows
  • Take care of mounting points on unix-like systems
  • No dependencies
  • TypeScript support

Install

npm install check-disk-space

Usage

// ES
import checkDiskSpace from 'check-disk-space'

// CommonJS
const checkDiskSpace = require('check-disk-space').default

// On Windows
checkDiskSpace('C:/blabla/bla').then((diskSpace) => {
    console.log(diskSpace)
    // {
    //     diskPath: 'C:',
    //     free: 12345678,
    //     size: 98756432
    // }
    // Note: `free` and `size` are in bytes
})

// On Linux or macOS
checkDiskSpace('/mnt/mygames').then((diskSpace) => {
    console.log(diskSpace)
    // {
    //     diskPath: '/',
    //     free: 12345678,
    //     size: 98756432
    // }
    // Note: `free` and `size` are in bytes
})

Readme

Keywords

Package Sidebar

Install

npm i @hyperplay/check-disk-space

Weekly Downloads

140

Version

3.5.2

License

MIT

Unpacked Size

22 kB

Total Files

6

Last publish

Collaborators

  • red-game-dev
  • elioebricenov
  • pimentelx
  • mrqz
  • nyghtstalker
  • awantoch
  • zpelkey
  • brad.decker
  • flaviofearn
  • blingus