Skip to content

Commit

Permalink
docs: improve docs with bytes unit and introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Jun 13, 2021
1 parent 4d4d41b commit 9210ef8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
[![check-disk-space on npm](https://img.shields.io/npm/v/check-disk-space?style=for-the-badge)](https://www.npmjs.com/package/check-disk-space)
[![License MIT](https://img.shields.io/github/license/Alex-D/check-disk-space.svg?style=for-the-badge)](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
Expand All @@ -25,6 +37,7 @@ checkDiskSpace('C:/blabla/bla').then((diskSpace) => {
// free: 12345678,
// size: 98756432
// }
// Note: `free` and `size` are in bytes
})

// On Linux or macOS
Expand All @@ -35,5 +48,6 @@ checkDiskSpace('/mnt/mygames').then((diskSpace) => {
// free: 12345678,
// size: 98756432
// }
// Note: `free` and `size` are in bytes
})
```
3 changes: 0 additions & 3 deletions src/errors/invalidPathError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @public
*/
class InvalidPathError extends Error {
name = 'InvalidPathError'

Expand Down
3 changes: 0 additions & 3 deletions src/errors/noMatchError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @public
*/
class NoMatchError extends Error {
name = 'NoMatchError'

Expand Down
1 change: 0 additions & 1 deletion src/functions/getFirstExistingParentPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Dependencies from '@/src/types/dependencies'

/**
* Get the first existing parent path
* @public
*
* @param directoryPath - The file/folder path from where we want to know disk space
* @param dependencies - Dependencies container
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import DiskSpace from '@/src/types/diskSpace'

/**
* Check disk space
* @public
*
* @param directoryPath - The file/folder path from where we want to know disk space
* @param dependencies - Dependencies container
Expand Down
3 changes: 0 additions & 3 deletions src/types/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {ChildProcess, ExecFileException} from 'child_process'
import {existsSync} from 'fs'
import {normalize, sep} from 'path'

/**
* @public
*/
type Dependencies = {
platform: NodeJS.Platform
fsExistsSync: typeof existsSync
Expand Down
2 changes: 1 addition & 1 deletion src/types/diskSpace.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @public
* `free` and `size` are in bytes
*/
type DiskSpace = {
diskPath: string
Expand Down

0 comments on commit 9210ef8

Please sign in to comment.