dmg-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

dmg-utils [WIP]

Util lib for DMG files.

npm libera manifesto

By now it only works on macOS.

Install

npm install dmg-utils

API

mount

declare const mount: (
  dmgPath: string,
  callback?: ((volumePath: string) => void) | undefined
) => Promise<string>

Returns mounted volume path.

unmount

declare const unmount: (
  volumePath: string,
  callback?: (() => void) | undefined
) => Promise<void>

extract

declare const extract: (dmgPath: string, destPath: string) => Promise<void>

Uses copy from fs-extra.

generateCommand

declare type Action = 'mount -nobrowse' | 'unmount'
declare type Command = `hdiutil ${Action} "${string}"`
declare const generateCommand: ({
  mount
}: {
  mount: boolean
}) => (path: string) => Command
import { generateCommand } from 'dmg-utils'

generateCommand({ mount: true })('./App.dmg')
// => 'hdiutil mount -nobrowse "./App.dmg"'

generateCommand({ mount: false })('/Volumes/App')
// => 'hdiutil unmount "/Volumes/App"'

License

MIT License © 2020 Exuanbo

Readme

Keywords

Package Sidebar

Install

npm i dmg-utils

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

10.5 kB

Total Files

10

Last publish

Collaborators

  • exuanbo