38
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NW.js (node-webkit) の開発をすぐ始める

Posted at

![icon] (http://www.softantenna.com/wp/wp-content/uploads/2015/01/INW.js.png)

[NW.js (node-webkit)] (http://nwjs.io/) は HTML+CSS+Node.jsでネイティブGUIアプリが作成できる凄いやつです.
[githubページ] (https://github.com/nwjs/nw.js)を見ると,開発を始めるにはまず本体をダウンロードする必要があるかのような記述ですが・・・

実際は,__npmコマンド__で始められます!

1. 適当なindex.htmlを作る

<!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>

2. npm initする

$ npm init
entry point (index.js) <== ここで index.html と答える
$ npm install --save nw

3. nwをインストール

$ npm install --save nw

4. package.jsonの中身に1行追加

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
+   "start": "nw"
  },
  "author": "",
  "license": "ISC"
}

5. 起動

$ npm start

スクリーンショット 2015-02-06 23.25.01.png

これでnw.jsアプリが起動しました!らくらくですね!

38
39
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
38
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?