Upgrade to Pro — share decks privately, control downloads, hide ads and more …

node.jsでつくられたものをいろいろ触ってみた

yasuo424
April 18, 2016

 node.jsでつくられたものをいろいろ触ってみた

node.js

yasuo424

April 18, 2016
Tweet

More Decks by yasuo424

Other Decks in Programming

Transcript

  1. ͱΓ͋͑ͣ hello, world • package.json • main.js • index.html 3ͭͷϑΝΠϧΛ༻ҙ

    { "name": "hello-electron", "main": "main.js" } QBDLBHFKTPO
  2. ͱΓ͋͑ͣ hello, world // Electron ͷϞδϡʔϧΛϩʔυ͢Δ var app = require('app');

    var BrowserWindow = require('browser- window'); var mainWindow = null; // ΢Οϯυ΢͕͢΂ͯดͨ͡ͱ͖ͷڍಈ Λఆٛ app.on('window-all-closed', function() { if (process.platform != 'darwin') { app.quit(); } }); app.on('ready', function() { // ϒϥ΢β΢Οϯυ΢Λ࡞Δ mainWindow = new BrowserWindow( { width: 800, height: 600 } ); // main.jsͱಉ͡σΟϨΫτϦʹ͋Δ index.htmlΛಡΈࠐΉ mainWindow.loadUrl( 'file://' + __dirname + '/index.html' ); mainWindow.on('closed', function() { mainWindow = null; }); }); NBJOKT