https://github.com/bennymeg/drive-name
Retrieve drive names natively on Windows
https://github.com/bennymeg/drive-name
drive name native nodejs volume
Last synced: 4 months ago
JSON representation
Retrieve drive names natively on Windows
- Host: GitHub
- URL: https://github.com/bennymeg/drive-name
- Owner: bennymeg
- License: apache-2.0
- Created: 2020-02-23T23:20:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T09:37:23.000Z (over 1 year ago)
- Last Synced: 2025-01-31T14:51:14.165Z (4 months ago)
- Topics: drive, name, native, nodejs, volume
- Language: C++
- Size: 296 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drive-name
Native implementation that retrieves drive volume name for a given drive mount point.
Currently supports Windows only.[](https://github.com/bennymeg/drive-name/blob/master/LICENSE)
[](https://www.npmjs.com/package/drive-name)
[](https://david-dm.org/bennymeg/drive-name)## Usage
```js
import { getDriveName } from 'drive-name';console.log(getDriveName('C://'));
```This module works great in conjunction with [drivelist](https://github.com/balena-io-modules/drivelist):
```js
import * as drivelist from 'drivelist';
import { getDriveName } from 'drive-name';// print all the drives and their names respectively
drivelist.list().then(drives => {
drives.forEach(drive => {
drive.mountpoints.forEach(mountpoint => console.log(mountpoint.path, getDriveName(mountpoint.path)));
});
});
```
**Author:** Benny Megidish.