跳转到主内容

Electron Simple Samples

· 阅读时间:约 2 分钟

We recently hosted an Electron hackathon at GitHub HQ for members of Hackbright Academy, a coding school for women founded in San Francisco. To help attendees get a head start on their projects, our own Kevin Sawicki created a few sample Electron applications.


If you're new to Electron development or haven't yet tried it out, these sample applications are a great place to start. They are small, easy to read, and the code is heavily commented to explain how everything works.

To get started, clone this repository:

git clone https://github.com/electron/simple-samples

To run any of the apps below, change into the app's directory, install dependencies, then start:

cd activity-monitor
npm install
npm start

Activity Monitor

Shows a doughnut chart of the CPU system, user, and idle activity time.

截屏

哈希

Shows the hash values of entered text using different algorithms.

截屏

镜像

Plays a video of the computer's camera at a maximized size like looking into a mirror. Includes an optional rainbow filter effect that uses CSS animations.

Prices

Shows the current price of oil, gold, and silver using the Yahoo Finance API.

截屏

URL

Loads a URL passed on the command line in a window.

Other Resources

We hope these apps help you get started using Electron. Here are a handful other resources for learning more: