drive-name
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

drive-name

Native implementation that retrieves drive volume name for a given drive mount point. Currently supports Windows only.

licence npm version Dependencies status

Usage

import { getDriveName } from 'drive-name';
 
console.log(getDriveName('C://'));

This module works great in conjunction with drivelist:

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.

/drive-name/

    Package Sidebar

    Install

    npm i drive-name

    Weekly Downloads

    36

    Version

    1.0.3

    License

    Apache-2.0

    Unpacked Size

    17.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • benny.megidish