{
  "name": "electron-dl",
  "version": "1.7.0",
  "description": "Simplified file downloads for your Electron app",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/sindresorhus/electron-dl"
  },
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "sindresorhus.com"
  },
  "scripts": {
    "start": "electron test.js",
    "test": "xo"
  },
  "files": [
    "index.js"
  ],
  "keywords": [
    "electron",
    "app",
    "file",
    "download",
    "downloader",
    "progress"
  ],
  "dependencies": {
    "pupa": "^1.0.0",
    "unused-filename": "^0.1.0"
  },
  "devDependencies": {
    "electron": "^1.3.3",
    "xo": "*"
  },
  "xo": {
    "esnext": true,
    "envs": [
      "node",
      "browser"
    ],
    "rules": {
      "import/no-extraneous-dependencies": "off"
    }
  },
  "readme": "# electron-dl [![Build Status](https://travis-ci.org/sindresorhus/electron-dl.svg?branch=master)](https://travis-ci.org/sindresorhus/electron-dl)\n\n> Simplified file downloads for your [Electron](http://electron.atom.io) app\n\n\n## Why?\n\n- One function call instead of having to manually implement a lot of [boilerplate](index.js).\n- Saves the file to the users Downloads directory instead of prompting.\n- Bounces the Downloads directory in the dock when done. *(macOS)*\n- Shows download progress. Example on macOS:\n\n<img src=\"screenshot.png\" width=\"82\">\n\n\n## Install\n\n```\n$ npm install --save electron-dl\n```\n\n\n## Usage\n\n### Register it for all windows\n\nThis is probably what you want for your app.\n\n```js\nconst {app, BrowserWindow} = require('electron');\n\nrequire('electron-dl')();\n\nlet win;\n\napp.on('ready', () => {\n\twin = new BrowserWindow();\n});\n```\n\n### Use it manually\n\nThis can be useful if you need download functionality in a reusable module.\n\n```js\nconst {app, BrowserWindow, ipcMain} = require('electron');\nconst {download} = require('electron-dl');\n\nipcMain.on('download-btn', (e, args) => {\n\tdownload(BrowserWindow.getFocusedWindow(), args.url)\n\t\t.then(dl => console.log(dl.getSavePath()))\n\t\t.catch(console.error);\n});\n```\n\n## API\n\n### electronDl([options])\n\n### electronDl.download(window, url, [options]): Promise<[DownloadItem](https://github.com/electron/electron/blob/master/docs/api/download-item.md)>\n\n### window\n\nType: `BrowserWindow`\n\nWindow to register the behavior on.\n\n### url\n\nType: `string`\n\nURL to download.\n\n### options\n\n#### saveAs\n\nType: `boolean`<br>\nDefault: `false`\n\nShow a `Save As…` dialog instead of downloading immediately.\n\nNote: Only use this option when strictly necessary. Downloading directly without a prompt is a much better user experience.\n\n#### directory\n\nType: `string`<br>\nDefault: [User's downloads directory](http://electron.atom.io/docs/api/app/#appgetpathname)\n\nDirectory to save the file in.\n\n#### errorTitle\n\nType: `string`<br>\nDefault: `Download Error`\n\nTitle of the error dialog. Can be customized for localization.\n\n#### errorMessage\n\nType: `string`<br>\nDefault: `The download of {filename} was interrupted`\n\nMessage of the error dialog. `{filename}` is replaced with the name of the actual file. Can be customized for localization.\n\n#### onProgress\n\nType: `Function`\n\nOptional callback that receives a number between `0` and `1` representing the progress of the current download.\n\n#### openFolderWhenDone\n\nType: `boolean`<br>\nDefault: `false`\n\nReveal the downloaded file in the system file manager, and if possible, select the file.\n\n\n## Related\n\n- [electron-debug](https://github.com/sindresorhus/electron-debug) - Adds useful debug features to your Electron app\n- [electron-context-menu](https://github.com/sindresorhus/electron-context-menu) - Context menu for your Electron app\n- [electron-config](https://github.com/sindresorhus/electron-config) - Simple config handling for your Electron app or module\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
  "readmeFilename": "readme.md",
  "bugs": {
    "url": "https://github.com/sindresorhus/electron-dl/issues"
  },
  "homepage": "https://github.com/sindresorhus/electron-dl",
  "_id": "electron-dl@1.7.0",
  "_shasum": "a96ba9eb6f3f06d82d60f02e30127efd15d040fa",
  "_from": "electron-dl@^1.2.0",
  "_resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.7.0.tgz"
}
