Electron Quick Startを試しました。
$ npm --version
2.1.5
$ npm install electron-prebuilt -g
$ mkdir hello
$ cd hello
$ vi package.json
$ vi main.js
$ vi index.html
$ cd ..
$ electron hello
package.json
{"name" : "hello-app",
"version" : "0.1.0",
"main" : "main.js"
}
main.js
// http://electron.atom.io/docs/latest/tutorial/quick-start/
var app = require('app');
var BrowserWindow = require('browser-window');
require('crash-reporter').start();
var mainWindow = null;
.on('window-all-closed', function() {
appif (process.platform != 'darwin') {
.quit();
app
};
})
.on('ready', function() {
app= new BrowserWindow({width: 800, height: 600});
mainWindow
.loadUrl('file://' + __dirname + '/index.html');
mainWindow
.openDevTools();
mainWindow
.on('closed', function() {
mainWindow= null;
mainWindow ;
}); })
index.html
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<p>
<a href="http://electron.atom.io/docs/latest/tutorial/quick-start/">QuickStart</a>
</p>
<p>
<script>document.write(process.version)</script>.
We are using io.js </p><p>
<script>document.write(process.versions['electron'])</script>.
We are using Electron </p>
</body>
</html>