https://github.com/angrycoding/hdiutil
OSX hdiutil api for Node.js
https://github.com/angrycoding/hdiutil
Last synced: 10 months ago
JSON representation
OSX hdiutil api for Node.js
- Host: GitHub
- URL: https://github.com/angrycoding/hdiutil
- Owner: angrycoding
- Created: 2016-12-26T08:58:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-18T11:23:50.000Z (about 9 years ago)
- Last Synced: 2025-04-09T18:14:41.199Z (10 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hdiutil [](https://npmjs.org/package/hdiutil)
Provides limited set of OSX hdiutil api for Node.js
### Installation
```bash
npm install hdiutil
```
### Retrieve information about already attached image by it's path
```javascript
var hdiutil = require('hdiutil');
hdiutil.info('image.dmg', function(error, mountPath, devicePath) {
console.info(error, mountPath, devicePath);
});
```
### Attaching image
```javascript
var hdiutil = require('hdiutil');
hdiutil.attach('image.dmg', function(error) {
console.info(error, mountPath, devicePath);
}, {
// password dialog title (if needed)
prompt: "Enter the password",
// password that will be automatically passed to stdin (in case if omitted standard dialog will be shown)
password: "...",
// how many times to repeat authorization attempts (default = 0)
repeat: 5,
// read-only mount (default = false)
readonly: true,
// hide it from user (default = false)
nobrowse: true,
// auto open in Finder (default = false)
autoopen: true
});
```
### Detaching image
```javascript
var hdiutil = require('hdiutil');
hdiutil.detach('image.dmg', function(error) {
console.info(error);
}, true /* force detach */);
```