JSPM

  • Created
  • Published
  • Downloads 24883
  • Score
    100M100P100Q140087F
  • License MIT

Package Exports

  • appdmg

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (appdmg) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-appdmg

Generate beautiful DMG-images for your OS X applications.

Installation

npm install -g appdmg

Usage

appdmg <json-path> <dmg-path>
  • json-path: Path to the JSON Specification file
  • dmg-path: Path at which to place the final DMG

Test

To produce a test DMG to your desktop, run the following command:

appdmg test/appdmg.json ~/Desktop/test.dmg

JSON Specification

Visualization

The specification for the image is a simple json file, example provided below. All paths are relative to the json-file's path. (Comments are not allowed, I'm only using them for demonstration purposes.)

{

  // The title of the produced DMG, which will be shown when mounted
  "title": "Test Title",

  // Path to your .app
  "app": "TestApp.app",

  // Path to your background
  "background": "TestBkg.png",

  // Path to your icon, which will be shown when mounted
  "icon": "TestIcon.icns",

  // Size and position of the icons in the DMG
  // Positions are specified as X and Y in the center of said icon
  // "app" is your application
  // "alias" is an alias to the Applications folder
  "icons": {
    "size": 80,
    "app": [192, 344],
    "alias": [448, 344]
  }

}

API

The application can also be called from within another javascript file, example:

var appdmg = require('appdmg');

appdmg('test/appdmg.json', 'test.dmg', function (err, path) {
  // err is an potential error
  // path is the path to the final DMG
});

OS Support

Currently the only supported os is Mac OS X.

Supporing other operating systems would involve writing a custom .DS_Store writer, but if accomplished would bring improvements even to the Mac platform since we could drop all the apple script stuff which currently adds ~15 seconds to the build time and pops up the Finder.