Install check-disk-space Node package
This commit is contained in:
parent
131cb1abb1
commit
45e889b4b3
9 changed files with 641 additions and 0 deletions
53
node_modules/check-disk-space/README.md
generated
vendored
Normal file
53
node_modules/check-disk-space/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Check disk space
|
||||
|
||||
[](https://github.com/Alex-D/check-disk-space/actions/workflows/ci.yml)
|
||||
[](https://www.npmjs.com/package/check-disk-space)
|
||||
[](LICENSE)
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
```js
|
||||
// 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
|
||||
})
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue