Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

windows-drive-letters

3.1.0 • Public • Published

windows-drive-letters

Get a list of available drive letters for use.

AppVeyor NPM version devDependency Status devDependency Status

Install

$ npm i -S windows-drive-letters

Usage

letters & lettersSync

Get a list of all available drive letters for use:

Asynchronous

driveLetters.letters().then((letters) => {
  console.log(letters); // => ['A', 'B', ...]
}).catch((err) => {
  console.error(err);
});

Synchronous

const letters = driveLetters.lettersSync();
console.log(letters); // => ['A', 'B', ...]

Get a list of all available drive letters that are used (in use):

Asynchronous

driveLetters.usedLetters().then((letters) => {
  console.log(letters); // => ['C', 'D', ...]
}).catch((err) => {
  console.error(err);
});

Synchronous

const letters = driveLetters.usedLettersSync();
console.log(letters); // => ['C', 'D', ...]

randomLetter & randomLetterSync

Get a random letter, available for use:

Asynchronous

driveLetters.randomLetter().then((letter) => {
  console.log(letter); // => 'Q'
}).catch((err) => {
  console.error(err);
});

Synchronous

const letter = driveLetters.randomLetterSync();
console.log(letter); // => 'N'

Changelog

See the Releases section of our GitHub project for changelogs for each release version.

License

This software is released under the terms of the MIT license.

install

npm i windows-drive-letters

Downloadsweekly downloads

275

version

3.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability