0.0.6 • Published 7 years ago

hdiutil v0.0.6

Weekly downloads
38
License
MIT
Repository
github
Last release
7 years ago

hdiutil npm version

Provides limited set of OSX hdiutil api for Node.js

Installation

npm install hdiutil

Retrieve information about already attached image by it's path

var hdiutil = require('hdiutil');
hdiutil.info('image.dmg', function(error, mountPath, devicePath) {
  console.info(error, mountPath, devicePath);
});

Attaching image

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

var hdiutil = require('hdiutil');
hdiutil.detach('image.dmg', function(error) {
  console.info(error);
}, true /* force detach */);