Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knutkirkhorn/system-disk
💽 Get the system disk of the computer (e.g. `C:` or `/dev/sda`)
https://github.com/knutkirkhorn/system-disk
disk drive linx macos macosx nodejs system system-disk unix windows
Last synced: 22 days ago
JSON representation
💽 Get the system disk of the computer (e.g. `C:` or `/dev/sda`)
- Host: GitHub
- URL: https://github.com/knutkirkhorn/system-disk
- Owner: knutkirkhorn
- License: mit
- Created: 2018-01-28T00:03:54.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-03-02T18:41:07.000Z (over 1 year ago)
- Last Synced: 2024-10-04T21:51:47.751Z (about 1 month ago)
- Topics: disk, drive, linx, macos, macosx, nodejs, system, system-disk, unix, windows
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# system-disk
> Get the system disk of the computer (e.g. `C:` or `/dev/sda`)
For Windows this module uses the [`%SystemDrive%`](http://environmentvariables.org/SystemDrive) environment variable and the [`mount`](https://en.wikipedia.org/wiki/Mount_(Unix)) command for macOS and Linux.
## Installation
```
npm install system-disk
```## Usage
```js
import systemDisk from 'system-disk';const disk = await systemDisk();
console.log(disk);
// => C:
```## API
### systemDisk()
Returns the disk on the computer where the operating system is stored (the boot disk).
## Related
- [@knutkirkhorn/free-space](https://github.com/knutkirkhorn/free-space) - Get the amount of free space for a drive