2017-11-19 12:01:33 +00:00
|
|
|
[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)
|
2015-04-23 20:46:48 +00:00
|
|
|
|
2016-04-04 19:18:37 +00:00
|
|
|
[![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron)
|
2017-03-14 17:13:53 +00:00
|
|
|
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/bc56v83355fi3369/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron/branch/master)
|
2016-10-12 20:17:26 +00:00
|
|
|
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
|
2015-06-29 23:46:22 +00:00
|
|
|
[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/)
|
|
|
|
|
2017-11-17 04:44:21 +00:00
|
|
|
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹.
|
|
|
|
View these docs in other languages at [electron/electron-i18n](https://github.com/electron/electron-i18n/tree/master/content/).
|
2017-08-08 17:55:09 +00:00
|
|
|
|
2015-04-08 17:16:10 +00:00
|
|
|
The Electron framework lets you write cross-platform desktop applications
|
2015-11-03 17:13:48 +00:00
|
|
|
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
|
2016-05-24 17:20:52 +00:00
|
|
|
[Chromium](http://www.chromium.org) and is used by the [Atom
|
2017-11-19 12:01:33 +00:00
|
|
|
editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2015-04-24 00:00:04 +00:00
|
|
|
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
|
|
|
|
announcements.
|
|
|
|
|
2017-11-17 04:44:21 +00:00
|
|
|
This project adheres to the Contributor Covenant
|
2017-08-08 17:18:40 +00:00
|
|
|
[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).
|
2015-12-04 00:06:58 +00:00
|
|
|
By participating, you are expected to uphold this code. Please report unacceptable
|
2017-08-08 17:18:40 +00:00
|
|
|
behavior to [electron@github.com](mailto:electron@github.com).
|
2015-07-08 20:29:24 +00:00
|
|
|
|
2017-08-08 17:18:40 +00:00
|
|
|
## Installation
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2017-08-08 17:18:40 +00:00
|
|
|
To install prebuilt Electron binaries, use [`npm`](https://docs.npmjs.com/).
|
|
|
|
The preferred method is to install Electron as a development dependency in your
|
|
|
|
app:
|
2015-04-17 18:25:06 +00:00
|
|
|
|
2015-04-29 17:56:31 +00:00
|
|
|
```sh
|
2017-08-08 17:18:40 +00:00
|
|
|
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
|
2017-11-19 12:01:33 +00:00
|
|
|
[Electron versioning](https://electronjs.org/docs/tutorial/electron-versioning).
|
2017-08-08 17:18:40 +00:00
|
|
|
|
|
|
|
For more installation options and troubleshooting tips, see
|
2017-11-19 12:01:33 +00:00
|
|
|
[installation](https://electronjs.org/docs/tutorial/installation).
|
2017-08-08 17:18:40 +00:00
|
|
|
|
2017-11-19 17:48:09 +00:00
|
|
|
## Quick start
|
2016-11-14 21:52:07 +00:00
|
|
|
|
2017-11-17 04:44:21 +00:00
|
|
|
Clone and run the
|
2017-08-08 17:18:40 +00:00
|
|
|
[electron/electron-quick-start](https://github.com/electron/electron-quick-start)
|
|
|
|
repository to see a minimal Electron app in action:
|
|
|
|
|
2017-11-19 10:48:06 +00:00
|
|
|
```sh
|
2017-08-08 17:18:40 +00:00
|
|
|
git clone https://github.com/electron/electron-quick-start
|
|
|
|
cd electron-quick-start
|
|
|
|
npm install
|
|
|
|
npm start
|
2015-04-17 18:25:06 +00:00
|
|
|
```
|
|
|
|
|
2017-11-19 17:51:03 +00:00
|
|
|
## Resources for learning Electron
|
2016-11-14 21:52:07 +00:00
|
|
|
|
2017-11-19 12:01:33 +00:00
|
|
|
- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
|
2017-08-08 17:18:40 +00:00
|
|
|
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
|
2017-11-19 12:01:33 +00:00
|
|
|
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
|
2017-08-08 17:18:40 +00:00
|
|
|
- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
|
|
|
|
- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron
|
|
|
|
- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs
|
2015-01-19 14:30:33 +00:00
|
|
|
|
2017-08-08 17:18:40 +00:00
|
|
|
## Programmatic usage
|
|
|
|
|
|
|
|
Most people use Electron from the command line, but if you require `electron` inside
|
|
|
|
your **Node app** (not your Electron app) it will return the file path to the
|
|
|
|
binary. Use this to spawn Electron from Node scripts:
|
2015-01-19 14:30:33 +00:00
|
|
|
|
2017-08-08 17:18:40 +00:00
|
|
|
```javascript
|
|
|
|
const electron = require('electron')
|
|
|
|
const proc = require('child_process')
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2017-08-08 17:18:40 +00:00
|
|
|
// will print something similar to /Users/maf/.../Electron
|
|
|
|
console.log(electron)
|
|
|
|
|
|
|
|
// spawn Electron
|
|
|
|
const child = proc.spawn(electron)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Mirrors
|
|
|
|
|
|
|
|
- [China](https://npm.taobao.org/mirrors/electron)
|
2014-05-14 18:32:24 +00:00
|
|
|
|
2017-11-19 17:48:09 +00:00
|
|
|
## Documentation translations
|
2015-08-23 15:19:37 +00:00
|
|
|
|
2017-11-12 16:03:43 +00:00
|
|
|
Find documentation translations in [electron/electron-18n](https://github.com/electron/electron-i18n).
|
2015-08-23 15:19:37 +00:00
|
|
|
|
2014-05-14 18:32:24 +00:00
|
|
|
## Community
|
|
|
|
|
2015-10-03 05:42:34 +00:00
|
|
|
You can ask questions and interact with the community in the following
|
2015-09-09 18:34:20 +00:00
|
|
|
locations:
|
2015-11-03 05:16:12 +00:00
|
|
|
- [`electron`](http://discuss.atom.io/c/electron) category on the Atom
|
2015-09-09 18:34:20 +00:00
|
|
|
forums
|
|
|
|
- `#atom-shell` channel on Freenode
|
|
|
|
- [`Atom`](http://atom-slack.herokuapp.com/) channel on Slack
|
2017-05-05 16:34:53 +00:00
|
|
|
- [`electron-ru`](https://telegram.me/electron_ru) *(Russian)*
|
2015-12-02 15:27:23 +00:00
|
|
|
- [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)*
|
2017-11-10 09:26:07 +00:00
|
|
|
- [`electron-kr`](https://electron-kr.github.io/electron-kr) *(Korean)*
|
2016-12-25 09:07:25 +00:00
|
|
|
- [`electron-jp`](https://electron-jp.slack.com) *(Japanese)*
|
2017-05-01 13:33:25 +00:00
|
|
|
- [`electron-tr`](http://electron-tr.herokuapp.com) *(Turkish)*
|
2016-07-13 07:07:46 +00:00
|
|
|
- [`electron-id`](https://electron-id.slack.com) *(Indonesia)*
|
2016-06-22 08:02:14 +00:00
|
|
|
|
2015-10-03 05:42:34 +00:00
|
|
|
Check out [awesome-electron](https://github.com/sindresorhus/awesome-electron)
|
2015-09-09 18:34:20 +00:00
|
|
|
for a community maintained list of useful example apps, tools and resources.
|
2016-10-01 03:33:51 +00:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
2016-11-07 22:26:21 +00:00
|
|
|
[MIT](https://github.com/electron/electron/blob/master/LICENSE)
|
2016-11-07 20:08:11 +00:00
|
|
|
|
2016-11-07 22:26:21 +00:00
|
|
|
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).
|