1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 05:10:05 +02:00

update dependencies

This commit is contained in:
s2
2018-10-10 15:11:12 +02:00
parent da4083f574
commit 5c55c54b71
90877 changed files with 339776 additions and 33677 deletions

View File

@@ -1,8 +1,7 @@
# electron-download
[![Travis Build Status](https://travis-ci.org/electron-userland/electron-download.svg?branch=master)](https://travis-ci.org/electron-userland/electron-download)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/dtu6of8wgtva0t8l?svg=true)](https://ci.appveyor.com/project/Atom/electron-download)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/fmfbjmrs42d7bctn/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-download/branch/master)
[![NPM](https://nodei.co/npm/electron-download.png?downloads=true)](https://www.npmjs.com/package/electron-download)
@@ -12,19 +11,21 @@ Used by [electron-prebuilt](https://npmjs.org/electron-prebuilt) and [electron-p
### Usage
**Note: Requires Node >= 4.0 to run.**
```shell
$ npm install --global electron-download
$ electron-download --version=0.31.1
```
```javascript
var download = require('electron-download')
const download = require('electron-download')
download({
version: '0.25.1',
arch: 'ia32',
platform: 'win32',
cache: './zips' // defaults to <user's home directory>/.electron
cache: './zips'
}, function (err, zipPath) {
// zipPath will be the path of the zip that it downloaded.
// If the zip was already cached it will skip
@@ -56,10 +57,50 @@ ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
## or for a local mirror
ELECTRON_MIRROR="https://10.1.2.105/"
ELECTRON_CUSTOM_DIR="our/internal/filePath"
ELECTRON_CUSTOM_FILENAME="electron.zip"
```
You can set ELECTRON_MIRROR in `.npmrc` as well, using the lowercase name:
```plain
electron_mirror=https://10.1.2.105/
electron_custom_dir="our/internal/filePath"
electron_custom_filename="electron.zip"
```
You can also set the same variables in your project's package.json:
```json
{
"name" : "my-electron-project",
"config" : {
"electron_mirror": "https://10.1.2.105/",
"electron_custom_dir": "our/internal/filePath",
"electron_custom_filename": "electron.zip"
}
}
```
The order of precedence is:
1. npm config or .npmrc, uppercase (`process.env.NPM_CONFIG_ELECTRON_*`)
1. npm config or .npmrc, lowercase(`process.env.npm_config_electron_*`)
1. package.json (`process.env.npm_package_config_electron_*`)
1. environment variables (`process.env.ELECTRON_*`)
1. the options given to `download`
1. defaults
You can also disable checksum validation if you really want to (this is in
general a bad idea). Do this by setting `disableChecksumSafetyCheck` to `true`
in the options object. Use this only when testing local build of Electron,
if you have internal builds of Electron you should generate the SHASUMS file
yourself and let `electron-download` still perform its hash validations.
### Cache location
The location of the cache depends on the operating system, the defaults are:
- Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`
- MacOS: `~/Library/Caches/electron/`
- Windows: `$LOCALAPPDATA/electron/Cache` or `~/AppData/Local/electron/Cache/`
You can set the `ELECTRON_CACHE` environment variable to set cache location explicitly.