npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

drive-tools

v0.0.24

Published

Node.js package for listing drives and getting system path (Desktop, Downloads, and etc)

Readme

drive-tools

drive-tools is a Node.js package for listing drives and getting system path (Desktop, Downloads, and etc).

Current version supports MacOS and Windows;

Install

npm install drive-tools

Usage

const driveTools = require('drive-tools')

console.log(driveTools.systemPath("desktop"));
// Available: home, desktop, pictures, downloads, music, movies, documents

console.log(driveTools.driveList());

Testing

Run the test suite:

npm test

For detailed output and debugging:

npm run test:sandbox

driveTools.driveList

The return value is an Array, looks like:

[
  { name: '/', desc: 'Internal', external: false },
  { name: '/System/Volumes/Data', desc: 'Internal', external: false },
,
  { name: '/Volumes/USB-Drive', desc: 'External', external: true }
]

Only for Windows, It's able to specity drive type.

0 = Unknown
1 = No Root Directory
2 = Removable Disk
3 = Local Disk
4 = Network Drive
5 = Compact Disc
6 = RAM Disk

For example, if you want to list up only CD-ROM drive:

console.log(driveTools.driveList(5));
[ 
  { name: 'Name', desc: 'Description', external: false },
  { name: 'D:', desc: 'CD-ROM Disc', external: true } 
]

Windows PowerShell Support

On Windows, this package now uses PowerShell by default for better compatibility and performance. If PowerShell is not available or fails, it automatically falls back to the legacy wmic method.

You can also force the use of wmic by passing true as the third parameter:

// Force use of wmic (legacy method)
console.log(driveTools.driveList(undefined, undefined, true));

Required

Please install encoding-japanese. npm install encoding-japanese

Repository Migration Notice

This package has been migrated to GitHub. The npm package will continue to work as before, but the source code is now available at: https://github.com/Luftchen/drive-tools

Support

Zelda, inc : https://zeldainc.com/
Author : Hiroki Tanaka (@Luftchen)
X : https://x.com/hrktnk

History

2020-06-19(0.0.1): created beta version
2020-06-19(0.0.11): bug fix
2020-06-24(0.0.12): added driveTools.systemPath("home")
2020-06-25(0.0.14): bug fix
2020-07-01(0.0.15): bug fix
2020-07-12(0.0.16): added drive type paramater for driveList() (only for windows)
2020-07-12(0.0.17): bug fix
2020-07-29(0.0.18): added MediaType only for Mac
2021-05-10(0.0.19): bug fix
2021-06-03(0.0.20): bug fix
2025-06-24(0.0.21): migrated repository to GitHub, added proper package.json metadata
2025-06-24(0.0.22): added PowerShell support for Windows with wmic fallback, added use_wmic flag
2025-06-27(0.0.23, 0.0.24): bug fix