Code Monkey home page Code Monkey logo

electron-download's Introduction

electron-download

Build Status

NPM

downloads a electron release zip from github

used by electron-prebuilt and electron-packager

usage

$ npm install --global electron-download
$ electron-download --version=0.31.1
var download = require('electron-download')

download({
  version: '0.25.1',
  arch: 'ia32',
  platform: 'win32',
  cache: './zips' // defaults to <users home directory>/.electron
}, function (err, zipPath) {
  // zipPath will be the path of the zip that it downloaded.
  // if the zip was already cached it will skip
  // downloading and call the cb with the cached zip path
  // if it wasn't cached it will download the zip and save
  // it in the cache path
})

if you don't specify arch or platform args it will use require('os') to get them from the current OS. specifying version is mandatory.

If you would like to override the mirror location, three options are available. The mirror URL is composed as url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME.

You can set the ELECTRON_MIRROR or NPM_CONFIG_ELECTRON_MIRROR env or mirror opt variable to use a custom base URL for grabbing electron zips. The same pattern applies to ELECTRON_CUSTOM_DIR and ELECTRON_CUSTOM_FILENAME

## Electron Mirror of China
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-download's People

Contributors

fritx avatar kevinsawicki avatar lele85 avatar mafintosh avatar makotot avatar malept avatar max-mapper avatar obaratch avatar omrilitov avatar popomore avatar quicksnap avatar tehbilly avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.