Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
drivelist
Advanced tools
List all connected drives in your computer, in all major operating systems
List all connected drives in your computer, in all major operating systems.
Notice that this module does not require admin privileges to get the drives in any supported operating system.
Supports:
When the user executes drivelist.list()
, the module checks the operating
system of the client and executes the corresponding drive scanning script.
Examples (the output will vary depending on your machine):
const drivelist = require('drivelist');
const drives = await drivelist.list();
console.log(drives);
Mac OS X:
[
{
device: '/dev/disk0',
displayName: '/dev/disk0',
description: 'GUID_partition_scheme',
size: 68719476736,
mountpoints: [
{
path: '/'
}
],
raw: '/dev/rdisk0',
protected: false,
system: true
},
{
device: '/dev/disk1',
displayName: '/dev/disk1',
description: 'Apple_HFS Macintosh HD',
size: 68719476736,
mountpoints: [],
raw: '/dev/rdisk0',
protected: false,
system: true
}
]
GNU/Linux
[
{
device: '/dev/sda',
displayName: '/dev/sda',
description: 'WDC WD10JPVX-75J',
size: 68719476736,
mountpoints: [
{
path: '/'
}
],
raw: '/dev/sda',
protected: false,
system: true
},
{
device: '/dev/sdb',
displayName: '/dev/sdb',
description: 'DataTraveler 2.0',
size: 7823458304,
mountpoints: [
{
path: '/media/UNTITLED'
}
],
raw: '/dev/sdb',
protected: true,
system: false
}
]
Windows
[
{
device: '\\\\.\\PHYSICALDRIVE0',
displayName: 'C:',
description: 'WDC WD10JPVX-75JC3T0',
size: 68719476736,
mountpoints: [
{
path: 'C:'
}
],
raw: '\\\\.\\PHYSICALDRIVE0',
protected: false,
system: true
},
{
device: '\\\\.\\PHYSICALDRIVE1',
displayName: 'D:, F:',
description: 'Generic STORAGE DEVICE USB Device',
size: 7823458304,
mountpoints: [
{
path: 'D:'
},
{
path: 'F:'
}
],
raw: '\\\\.\\PHYSICALDRIVE1',
protected: true,
system: false
},
{
device: '\\\\.\\PHYSICALDRIVE2',
displayName: '\\\\.\\PHYSICALDRIVE2',
description: 'Silicon-Power2G',
size: 2014314496,
mountpoints: [],
raw: '\\\\.\\PHYSICALDRIVE2',
protected: false,
system: false
}
]
Install drivelist
by running:
$ npm install --save drivelist
Kind: inner method of drivelist
Summary: List available drives
Example
const drivelist = require('drivelist');
const drives = await drivelist.list();
drives.forEach((drive) => {
console.log(drive);
});
Run the test suite by doing:
$ npm test
We're looking forward to support more operating systems. Please raise an issue or even better, send a PR to increase support!
Before submitting a PR, please make sure that you include tests, and that the linter runs without any warning:
$ npm run lint
If you're having any problem, please raise an issue on GitHub.
The project is licensed under the Apache 2.0 license.
v12.0.2
FAQs
List all connected drives in your computer, in all major operating systems
The npm package drivelist receives a total of 8,908 weekly downloads. As such, drivelist popularity was classified as popular.
We found that drivelist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.