nodejs and electron code example

Example 1: electron

npm i -D electron@latest

Example 2: electron js

$ npm i -D electron@latest
# Electron   10.1.3
# Node       12.16.3
# Chromium   85.0.4183.121

Example 3: electron js

$ npm i -D electron@beta
# Electron   11.0.0-beta.9
# Node       12.18.3
# Chromium   87.0.4251.1

Example 4: electron js

$ npm i -D electron-nightly
# Electron   12.0.0-nightly.20200914
# Node       12.18.3
# Chromium   86.0.4234.0

Example 5: electron

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Hello World!</title>
    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body style="background: white;">
    <h1>Hello World!</h1>
    We are using node <script>document.write(process.versions.node)</script>,
    Chrome <script>document.write(process.versions.chrome)</script>,
    and Electron <script>document.write(process.versions.electron)</script>.
</body>
</html>
Copiar