README
DiskDrive
DiskDrive is a cross compatible binding for DVD and CD drives. It currently supports OSX and Linux.
Install
$ npm install diskdrive --save
CLI
$ npm install diskdrive -g
$ diskdrive [mount/id]
Mount / id is the same as the documentation's mount / id.
Documentation
function([id/mount], [callback(err)]);
Eject: First argument can be of type string
or int
. It specifies the mount / ID of the disk drive to eject.
Second argument is of type Function
, which takes an err
. If an error occurs ejecting the disk, it will be called with a respective Error
. It is always called upon completion (the error will be null
).
Example usage:
var diskdrive = require('diskdrive');
// Eject the primary disk drive.
// Note lack of callback (optional)
diskdrive.eject();
// [Mac] Eject disk of [id].
diskdrive.eject(2, function(error) {
if (error) console.log(error);
});
// [Linux] Eject disk drive, with specified mount.
diskdrive.eject('/dev/dvd', function(error) {
if (error) console.log(error);
});
diskdrive.eject('dvd'); // appended to /dev/, would result in same system file. (/dev/dvd)
Cross Compatibility
Currently, OSX and Linux have been tested and are confirmed to work. The following have been tested with good results:
- OSX 10.9.2
- OSX 10.9.5
- Ubuntu 12.04