Домой Edit me on GitHub

2020-12-05

Каналы передачи данных | Сетевое программирование | Базы данных | Основы Веб-программирования

node.js + WebKit

Установка:

$ npm install nw

Hello World

Примечание

Исходный код примера:

Структура файлов:

.
├── index.html
└── package.json

0 directories, 2 files
index.html
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js <script>document.write(process.version)</script>.
  </body>
</html>
package.json
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "name": "Hello",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "window": {
    "toolbar": false,
    "width": 200,
    "height": 180
  }
}

Запуск:

$ nw
../_images/hello_nw_js.png
Previous: Qt + WebKit Next: C#, обращение к REST API