Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drivelist

Package Overview
Dependencies
Maintainers
1
Versions
265
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drivelist - npm Package Compare versions

Comparing version 1.3.2 to 2.0.0

build/scripts.js

38

build/drivelist.js

@@ -1,32 +0,22 @@

var getOSModule, linux, os, osx, win32;
var os, parse, scripts;
os = require('os');
win32 = require('./win32');
parse = require('./parse');
osx = require('./osx');
scripts = require('./scripts');
linux = require('./linux');
getOSModule = function() {
var operatingSystem;
exports.list = function(callback) {
var operatingSystem, script;
operatingSystem = os.platform();
switch (operatingSystem) {
case 'darwin':
return osx;
case 'win32':
return win32;
case 'linux':
return linux;
default:
throw new Error("Your OS is not supported by this module: " + operatingSystem);
script = scripts.paths[operatingSystem];
if (script == null) {
throw new Error("Your OS is not supported by this module: " + operatingSystem);
}
return scripts.run(script, function(error, output) {
if (error != null) {
return callback(error);
}
return callback(null, parse(output));
});
};
exports.list = function(callback) {
return getOSModule().list(callback);
};
exports.isSystem = function(drive, callback) {
return getOSModule().isSystem(drive, callback);
};
{
"name": "drivelist",
"version": "1.3.2",
"version": "2.0.0",
"description": "List all connected drives in your computer, in all major operating systems",

@@ -39,3 +39,2 @@ "main": "build/drivelist.js",

"dependencies": {
"async": "^1.4.0",
"js-yaml": "^3.4.1",

@@ -42,0 +41,0 @@ "lodash": "^3.0.1",

@@ -41,3 +41,4 @@ drivelist

size: '*750.2 GB'
mountpoint: '/'
mountpoint: '/',
system: true
},

@@ -47,3 +48,4 @@ {

description: 'Apple_HFS Macintosh HD',
size: '*748.9 GB'
size: '*748.9 GB',
system: true
}

@@ -63,3 +65,4 @@ ]

size: '931.5G',
mountpoint: '/'
mountpoint: '/',
system: true
},

@@ -69,3 +72,4 @@ {

description: 'DVD+-RW GU90N',
size: '1024M'
size: '1024M',
system: false
}

@@ -85,3 +89,4 @@ ]

size: '1000 GB'
mountpoint: 'C:'
mountpoint: 'C:',
system: true
},

@@ -92,3 +97,4 @@ {

size: '15 GB'
mountpoint: 'D:'
mountpoint: 'D:',
system: false
}

@@ -121,11 +127,2 @@ ]

Predicates
----------
### drivelist.isSystem(drive, callback)
Determines if a drive returned by `drivelist.list()` is a system drive.
The callbacks gets passed a single boolean value.
Tests

@@ -159,41 +156,2 @@ -----

ChangeLog
---------
### v1.3.2
- Handle edge case where OS X drives contain a description within parenthesis in `diskutil list`.
### v1.3.1
- Surround Windows script path in double quotes to avoid issues with paths incuding white space.
### v1.3.0
- Add `mountpoint` attribute to drives.
### v1.2.2
- Fix issue where a removable drive was detected as a system drive in Linux.
### v1.2.1
Fix win32 issue where DeviceID gets part of the device description.
### v1.2.0
- Implement isSystem predicate.
### v1.1.2
- Prevent empty lsblk model crash the module. Return `undefined` description instead.
### v1.1.1
- Prevent empty wmic size crash the module. Return `undefined` size instead.
### v1.1.0
- Return non supported OS error to the callback instead of just throwing it.
License

@@ -200,0 +158,0 @@ -------

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc