Git Product home page Git Product logo

gulp-electron-downloader's Introduction

gulp-electron-downloader

A gulp.js plugin to download electron. Super simple, it will simply download (and cache) and extract to a directory of your choice. You can run with zero-configuration, and use the defaults. Or configure as you wish.

This plugin makes it really easy to get any electron binary you need, where as most others only download electron for the platform for the host.

If you're wanting to build an electron release, you'll need another plugin for that.

Installation

Install gulp plugin package:

npm install --save-dev gulp-electron-downloader

Usage

The most simple is the following:

var gulp = require('gulp');
var electronDownloader = require('gulp-electron-downloader');

gulp.task('download-electron', function(cb){

    electronDownloader(cb);

});

gulp.task('default', ['download-electron']);

This will download the latest release of electron, matching the platform and architecture of the host. The ./electron/cache folder will be used to store downloads, and the final output will end up ./electron/binaries.

The plugin makes unauthenticated requests to GitHub API. If you get rate-limit errors, use your own token by setting the env var GITHUB_OAUTH_TOKEN.

Constructor

electronDownloader([options], callback)

Options

You can customise what is downloaded with the following:

  • version - the version of electron you want to download. This defaults to the latest release.
  • platform - the platform you want to download. Choices are darwin, mas, win32, linux. This defaults to the host platform.
  • arch - the architecture of the platform you want to download. This defaults to the host architecture.
  • cacheDir - the location of the caching directory in which downloads will be stored. This defaults to ./electron/cache.
  • outputDir - the location of the unzipped binary. This defaults to ./electron/binaries/platform-arch/.
  • downloadMirror - a function that provided the official electron download URL for a particular version, returns a URL to a mirror of your choice. An example for China:
downloadMirror: function (downloadUrl) {
    return downloadUrl.replace('https://github.com/atom/electron/releases/download/v', 'https://npm.taobao.org/mirrors/electron/');
}

gulp-electron-downloader's People

Contributors

smebberson avatar

Watchers

 avatar  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.