ãã®ããã°ã¯ãmobage developers blogã2016.4.28ã®è¨äºã転è¼ããã¦ããã ãã¾ããã ããã«ã¡ã¯ãã»ãã¥ãªãã£æè¡ã°ã«ã¼ãã®ã¯ãã·ã§ããä»åã¯Electronã®ã»ãã¥ãªãã£ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ããã Electronã¨ã¯ãNode.jsã¨Chromiumããã¼ã¹ã¨ãããã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ãä½æããã¯ãã¹ãã©ãããã©ã¼ã å®è¡ç°å¢ã§ããHTMLãJavaScriptãªã©Webæè¡ã«ãã£ã¦ããã©ãããã©ã¼ã ã®éããæ°ã«ããã«æ軽ã«WindowsãMacãLinuxã®ãã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ãä½æã§ããã¨ããé¨åãç¹å¾´ã§ãã Webæè¡ãå©ç¨ãã¦éçºãã§ãããããWebæè¡è ã«ã¨ã£ã¦ã¯ããªãç°¡åã«ãã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ãä½ããããã«ãªããä»å¾ãæ§ã ãªã¢ããªã±ã¼ã·ã§ã³ãElectronã«ãã£ã¦éçºããã¦ããããã«ãªãã®ã§ã¯ãªããã¨èãã¦ãã¾ãã elect
@kjunichiã§ãããã®è¨äºã¯Qiita Node.js Advent Calendar 2019 6æ¥ã®è¨äºã§ãã èæ¯ ãã¾ã¼ã«ãæµè¡ã®GitHubè¦ã¦è»¢è·æ¡å ãã¦ããããµã¤ãã«ç»é²ãã¦ãã®ã§ã KeyCast.jsè¦ã¾ããï¼ãªãã¦ã¡ã¼ã«ãããã ããã¨ãããã¾ããã AIããã®ã¡ã¼ã«ãªã®ã¯ãã¬ãã¬ã§ãã¡ã³ã¿ã«è±è ãªã®ã§ããã®æ°å¹´ã¡ã³ããã¦ãããå¿è¦ããã«ãªããã¨ãããã®ã§ã éãè °ãä¸ãã¦å¯¾å¿ãããã¨ããããNodObjCãä¸å®å®ããã¦ãå¥ã®æ¹æ³ã模索ãã¦ããã ã£ã¦ã®ã¨ãKeycast.jsã以åã®ã¢ãã«ã¬ããã£ããã§ä½æããã®ã§ãæ°ãã¿ æãã¤ããªãã£ãã¨ããã®ãããã Node.jsã§ç´æ¥Cocoaãæ±ããªããªã£ãï¼ï¼ node-ffiã¯ããæ°å¹´æ´æ°ãããã¦ããªãç¶æ ãç¶ãã¦ããã NAPIã«å¯¾å¿ãã node-ffi-napiãä½ããã¦ãããããã¯Node.jsã«ã¹ã¬ããã
const ipcMain = require("electron").remote.ipcMain; ipcMain.on("message", (event, body)=>{...}); ã¬ã³ãã©ããã»ã¹ => ã¡ã¤ã³ããã»ã¹ ã¡ã¤ã³ããã»ã¹ => ã¬ã³ãã©ããã»ã¹ ããã¯ããããã®ã§ããã ã¬ã³ãã©ããã»ã¹ => ã¬ã³ãã©ããã»ã¹ ããããã¨ãã¦èºããã®ã§åå¿é²ã NGé
å©ç¨ãããã® Git npmããã±ã¼ã¸ã§githubããURLæå®ã§ãªãã¸ããªããåå¾ãã¦ããæã«å©ç¨ãã node.js electronã®node.jsã¯npmæã«èªåçã«ã¤ã³ã¹ãã¼ã«ããã npmãã¤ã³ã¹ãã¼ã«ãããéçºåããããã°èµ·åã«ä½¿ããã®ã§ãã¼ã¸ã§ã³ã¯ç¥çµè³ªã«ãªãå¿ è¦ã¯ç¡ã yarn npmããè¶ é«éã«ã¤ã³ã¹ãã¼ã«åºæ¥ã npm-shrinkwrap.jsonã«ãããyarn.lockãããã©ã«ãã§çæãããã®ã§ãã¼ã¸ã§ã³åºå®åã»çµ±ä¸ããããã npm install -g yarn yarn && cd src && yarn æ¬ããã¸ã§ã¯ãã§ã¯ã«ã¼ãã«ã¯electronä»ããããã°ããã«ãç¨devDependenciesããå®éã«ããã±ã¼ã¸ã³ã°ãããå ´åã«å¿ è¦ãªnode_moduleã¯src以ä¸ã«package.jsonãä½æãdependenciesã«è¿½å ãã¦ç¡é§ãªno
ãï¼æ³¨æäºé ãã»ã¼ç¡ããâ³ï¼åãããåããªãã£ãã注æäºé ããã (1)@abandonware/noble Node.jsããBLEæ©å¨ã¨éä¿¡ãè¡ãããã¡ã¯ãã®æ¹æ³ã¯nobleã§ããããã¡ãã¯æ´¾çã«ãªãã¾ããå ãªãã¸ããªã®ã¡ã³ããã³ã¹ãæ¢ã¾ã£ã¦ãã¾ã£ãããæ··è¿·ã極ãã¦ãã¾ãããã2023/05æç¾å¨@abandonware/nobleã§3OSç¶²ç¾ ãããã®ã§ãã°ãã主æµã¨ãªãã§ãããã Windows 1.9.2-17 ããWinRTå®è£ ãçµã¿è¾¼ã¾ãã¾ãããOSã®ãã¼ã¸ã§ã³ã10.0.15063以ä¸ã ã¨ãã¡ãã®bindingsã使ç¨ããã¾ãã 10.0.15063以ä¸ã ã¨ãã©ã¤ãã¼ãã¤ã³ã¹ãã¼ã«ããã«ä½¿ç¨å¯è½ã§ã 10.0.15063æªæºã§ã¯æ§æ¥ã®WinUSBãã©ã¤ãã¼ãã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¢ã¸ã¥ã¼ã«ãçæããã¾ãï¼lib/resolve-bindings.js åç §ï¼ VS2017
Electronãããã¡ã¤ã«ãåºåããããã®ã§ãããå®è¡ã¢ããªã®ãã©ã«ãã¼ã®ãã¹ãç¥ããã¨ã¯ã§ããªãã§ããããã(test.app, hoge.exeãªã©ã®ä¸ã¤ä¸ã®ãã¹) __dirnameãªã©ã§åå¾ãããã¨ãã¦ããasarãã¡ã¤ã«ã®ä½ç½®ããåå¾ã§ãã¾ããã ç¾ç¶__dirnameãæ£è¦è¡¨ç¾ã§æ´å½¢ãã¦ã´ãªæ¼ããã¦ããã®ã§ããããæ¹æ³ãªã©ããã°æãã¦ãã ããã 追è¨: windowsã§ã®ãã¹ã®åå¾ã¯ã§ãã¾ããã®ã§ãmacã§ã®åå¾æ¹æ³ãã©ãªããæãã¦ãã ããã app.getAppPath()è¥ããã¯app.getPath("exe")ã§åå¾ãããã¹ãæ´å½¢ãã¦ãããã®ã§ãããä¸çºã§åå¾ããæ¹æ³ãæ¢ãã¦ãã¾ãã electron-builderã使ã£ã¦portableè¨å®ãããwindowsã¢ããªã±ã¼ã·ã§ã³ãä½ã£ãå ´åãprocess.env.PORTABLE_EXECUTABLE_DIRã使ç¨
ãã¾ããã»ãªãªã¼èªããã»ã©ãElectronãã£ã¦ãªãã ããã globalShortcut https://electronjs.org/docs/api/global-shortcut Electronã«ã¯ã·ã§ã¼ãã«ãããã¼ãå¶å¾¡ããglobalShortcutã¨ããæ©è½ããããã§ããã©ã ããã¯å ¬å¼ããã¥ã¡ã³ãã«ãæ¸ãã¦ããã¨ãããã°ãã¼ãã«ã«å¹ãã¦ãã¾ãã ã¢ããªã«ãã©ã¼ã«ã¹ãå½ãã£ã¦ç¡ãã¦ããå¹ãã¡ãããã§ããã ããã¯ããã§ä¾¿å©ã ãã©ãå¹ãéãã¡ããã ãããªCommand+Sãå°ããã¢ããªã¨ãä½ã£ãããããããã¢ããªã®Command+Sãå°ãã¡ãã£ã¦å¤§å¤ã§ããã ãã£ã¦ã¯ããã¾ãããã 'use strict'; const electron = require('electron'); const app = electron.app; const globalShortc
ç®ç åããElectronãã¹ã¯ãããã¢ããªã«ããOAuthããã»ã¹ãç¥ã ããããåãããè¦ãã ã¯ãã github.com ã´ã¼ã« æå ã®Electronã¢ããªã§ããã°ã¤ã³ã¦ã¼ã¶ï¼ãã®å ´åãåèªèº«ï¼ã®APIãã¼ã¯ã³ã§ãGoogleã®ãªãããã®APIãå©ãã â ç»é²ããã¢ããªä¸ã§ããããä½æããAPIãã¼ã¯ã³ã§ã¯ãªãã®ããã½ æ¬ç¨¿ã§ãããªãã㨠OAuthã¨ã¯ãªã«ãã®ãã£ã¨ãããããããã¤ï¼ããã©å¥ã¨ã³ããªã§æ¸ãããï¼ å¾ãããAPI Tokenã®æ°¸ç¶ä¿åï¼electron-json-storageã§ã使ãï¼ Expireæã®Refreshã®å®è£ ï¼å²æï¼ åèè³æ Using OAuth 2.0 to Access Google APIs  | Google Identity Platform  | Google Developers Using OAuth 2.0 for
èæ¯ arduinoãæã«å ¥ãã¦ãä½ãPCã¨é£æºãã¦ã¿ãããªã£ãã Arduinoã§æ¸¬ã£ã室温ããã¹ã¯ããããã¹ã³ããã®gopheronã«è¡¨ç¤º æ§æ node.jsã§arduinoã®è¨æ¸¬çµæãã·ãªã¢ã«ãã¼ãçµç±ã§åä¿¡ãããã¡ã¤ã«ã«åºå ãã¡ã¤ã«åºåã¯ãªãã¤ã¬ã¯ãã§å®ç¾ node.jsã§arduinoã®è¨æ¸¬çµæãã·ãªã¢ã«ãã¼ãçµç±ã§åä¿¡ ã·ãªã¢ã«éä¿¡ã«ã¯ã以ä¸ã®ã¢ã¸ã¥ã¼ã«ã使ç¨ããã serialport.io ã¤ã³ã¹ãã¼ã«ã¯ä»¥ä¸ã®ããã«ã§ããã npm i -S serialport ãã®serialportã¢ã¸ã¥ã¼ã«ã¯ãã¼ãµã¼ãããã¤ãé¸ã¹ãããã§ãä»åã¯readLineãã¼ãµã¼ã使ã£ã¦ã arduinoå´ã§"\n"ãå ¥ãããã¨ã§ããã®ãã¼ãµã¼ã¨é£æºããã node.jsã®åä¿¡é¨ const SerialPort = require("serialport") const Readlin
ããã°ãã¯ããçã®ä¼ã¿ã¯å¥¥ãããä»äºã ã£ãã®ã§ãè¿å ´ã®é«å°¾å±±ã«åä¾ãã¡ã¨ä¸ç·ã«è¡ã£ã¦ãã@kjunichiã§ãã èæ¯ Electronãã¼ã¹ã®3Dãã¹ã¯ããããã¹ã³ããã¢ããªã®gopheronãç´°ã ã¨éçºãã¦ãã ãã®ã¢ããªã«Raspberry Piã®CPU温度ã表示ãããæ©è½ã追å ãããã¨ãªã©ã ã¤ã³ã¹ã¿ã§æ稿ããããçµæ§æµ·å¤ã§è¯ãåå¿ãè²°ããã¨ãããã ãããªã¢ããªã®ã¢ã¤ã³ã³ãElectronã®ããã©ã«ããªã®ã¯ããããåé¡ãããªãã㨠éãè °ãä¸ãã¦åãçµãã ãªã«ã¯ãªãã¨ãã¢ã¤ã³ã³ç»åã®ç¨æã¨èªã¿è¾¼ã¿ macOSãWindowså ±ã«NativeImageåã®ç»åãã¼ã¿ãç¨æããã ãã®çºã«ã¯ãnativeImage#createFromPathã¡ã½ãããå©ç¨ãããã¨ã§ãç»åãã¡ã¤ã«ããNativeImageåãåå¾ã§ããã const { app, BrowserWindow, i
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}