You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

electron

Package Overview
Dependencies
Maintainers
2
Versions
1502
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron - npm Package Compare versions

Comparing version

to
7.3.3

2

cli.js

@@ -7,3 +7,3 @@ #!/usr/bin/env node

var child = proc.spawn(electron, process.argv.slice(2), {stdio: 'inherit', windowsHide: false})
var child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false })
child.on('close', function (code) {

@@ -10,0 +10,0 @@ process.exit(code)

@@ -6,6 +6,14 @@ var fs = require('fs')

if (fs.existsSync(pathFile)) {
module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8'))
} else {
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
function getElectronPath () {
if (fs.existsSync(pathFile)) {
var executablePath = fs.readFileSync(pathFile, 'utf-8')
if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath)
}
return path.join(__dirname, 'dist', executablePath)
} else {
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
}
}
module.exports = getElectronPath()
#!/usr/bin/env node
var version = require('./package').version
const version = require('./package').version
var fs = require('fs')
var os = require('os')
var path = require('path')
var extract = require('extract-zip')
var download = require('electron-download')
const fs = require('fs')
const os = require('os')
const path = require('path')
const extract = require('extract-zip')
const { downloadArtifact } = require('@electron/get')
var installedVersion = null
let installedVersion = null
try {

@@ -18,30 +18,27 @@ installedVersion = fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '')

var platformPath = getPlatformPath()
if (installedVersion === version && fs.existsSync(path.join(__dirname, platformPath))) {
if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) {
process.exit(0)
}
var mirror
const platformPath = getPlatformPath()
if (version.indexOf('nightly') !== -1) {
mirror = 'https://github.com/electron/nightlies/releases/download/v'
const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath)
if (installedVersion === version && fs.existsSync(electronPath)) {
process.exit(0)
}
// downloads if not cached
download({
cache: process.env.electron_config_cache,
version: version,
platform: process.env.npm_config_platform,
arch: process.env.npm_config_arch,
strictSSL: process.env.npm_config_strict_ssl === 'true',
downloadArtifact({
version,
artifactName: 'electron',
force: process.env.force_no_cache === 'true',
quiet: process.env.npm_config_loglevel === 'silent' || process.env.CI,
mirror
}, extractFile)
cacheRoot: process.env.electron_config_cache,
platform: process.env.npm_config_platform || process.platform,
arch: process.env.npm_config_arch || process.arch
}).then((zipPath) => extractFile(zipPath)).catch((err) => onerror(err))
// unzips and makes path.txt point at the correct executable
function extractFile (err, zipPath) {
if (err) return onerror(err)
extract(zipPath, {dir: path.join(__dirname, 'dist')}, function (err) {
function extractFile (zipPath) {
extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) {
if (err) return onerror(err)

@@ -59,12 +56,12 @@ fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) {

function getPlatformPath () {
var platform = process.env.npm_config_platform || os.platform()
const platform = process.env.npm_config_platform || os.platform()
switch (platform) {
case 'darwin':
return 'dist/Electron.app/Contents/MacOS/Electron'
return 'Electron.app/Contents/MacOS/Electron'
case 'freebsd':
case 'linux':
return 'dist/electron'
return 'electron'
case 'win32':
return 'dist/electron.exe'
return 'electron.exe'
default:

@@ -71,0 +68,0 @@ throw new Error('Electron builds are not available on platform: ' + platform)

{
"scripts": {
"cache-clean": "rm -rf ~/.electron && rm -rf dist",
"postinstall": "node install.js",
"pretest": "npm run cache-clean",
"test": "standard"
},
"main": "index.js",
"types": "electron.d.ts",
"bin": {
"electron": "cli.js"
},
"main": "index.js",
"types": "electron.d.ts",
"scripts": {
"postinstall": "node install.js"
},
"dependencies": {
"@types/node": "^8.0.24",
"electron-download": "^3.0.1",
"@electron/get": "^1.0.1",
"@types/node": "^12.0.12",
"extract-zip": "^1.0.3"
},
"devDependencies": {
"home-path": "^0.1.1",
"path-exists": "^2.0.0",
"standard": "^5.4.1"
"engines": {
"node": ">= 8.6"
},
"directories": {
"test": "test"
},
"name": "electron",
"version": "2.0.18",
"version": "7.3.3",
"repository": "https://github.com/electron/electron",

@@ -29,0 +21,0 @@ "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",

@@ -5,9 +5,7 @@ [![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)

[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)
[![AppVeyor Build Status](https://windows-ci.electronjs.org/api/projects/status/nilyf07hcef14dvj/branch/master?svg=true)](https://windows-ci.electronjs.org/project/AppVeyor/electron/branch/master)
[![Jenkins Build Status](https://mac-ci.electronjs.org/buildStatus/icon?job=Electron%20org/electron/master)](https://mac-ci.electronjs.org/blue/organizations/jenkins/Electron%20org%2Felectron/activity?branch=master)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
[![Join the Electron Community on Slack](https://atom-slack.herokuapp.com/badge.svg)](https://atom-slack.herokuapp.com/)
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹.
View these docs in other languages at [electron/electron-i18n](https://github.com/electron/electron-i18n/tree/master/content/).
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱.
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).

@@ -34,7 +32,7 @@ The Electron framework lets you write cross-platform desktop applications

```sh
npm install electron --save-dev --save-exact
npm install electron --save-dev [--save-exact]
```
The `--save-exact` flag is recommended as Electron does not follow semantic
versioning. For info on how to manage Electron versions in your apps, see
The `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic
versioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).

@@ -45,5 +43,10 @@

## Quick start
## Quick start & Electron Fiddle
Clone and run the
Use [`Electron Fiddle`](https://github.com/electron/fiddle)
to build, run, and package small Electron experiments, to see code examples for all of Electron's APIs, and
to try out different versions of Electron. It's designed to make the start of your journey with
Electron easier.
Alternatively, clone and run the
[electron/electron-quick-start](https://github.com/electron/electron-quick-start)

@@ -62,2 +65,3 @@ repository to see a minimal Electron app in action:

- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
- [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app

@@ -92,4 +96,8 @@ - [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community

Find documentation translations in [electron/electron-i18n](https://github.com/electron/electron-i18n).
Find documentation translations in [electron/i18n](https://github.com/electron/i18n).
## Contributing
If you are interested in reporting/fixing issues and contributing directly to the code base, please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information on what we're looking for and how to get started.
## Community

@@ -96,0 +104,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet