Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brendanashworth/diskdrive
OS compatible bindings for various CD/DVD drive utilities with NodeJS (OSX + Linux supported)
https://github.com/brendanashworth/diskdrive
Last synced: 9 days ago
JSON representation
OS compatible bindings for various CD/DVD drive utilities with NodeJS (OSX + Linux supported)
- Host: GitHub
- URL: https://github.com/brendanashworth/diskdrive
- Owner: brendanashworth
- License: mit
- Created: 2014-05-28T00:18:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-15T21:33:24.000Z (about 10 years ago)
- Last Synced: 2023-04-10T02:50:03.645Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 188 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DiskDrive
=====
[![Build Status](https://travis-ci.org/brendanashworth/diskdrive.svg?branch=master)](https://travis-ci.org/brendanashworth/diskdrive)[![DiskDrive NPM](https://nodei.co/npm/diskdrive.png)](http://npmjs.org/package/diskdrive)
> DiskDrive is a cross compatible binding for DVD and CD drives. It currently supports OSX and Linux.
## Install
```bash
$ npm install diskdrive --save
```## CLI
```bash
$ npm install diskdrive -g
``````bash
$ diskdrive [mount/id]
```
Mount / id is the same as the documentation's mount / id.## Documentation
#### Eject: `function([id/mount], [callback(err)]);`
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:
```javascript
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### License
[MIT](./LICENSE)