第7åNode.jsã¢ããªã±ã¼ã·ã§ã³ãWindow Azureã§åãã é«æ©ä¿å 2012-11-27
æ¬æ¸ã«ã¤ã㦠æ¬æ¸ã¯ãNode.jsã§ã®ã¢ããªã±ã¼ã·ã§ã³éçºãå§ãããã¨ããçããã«ã âé«åº¦ãªâJavaScriptã«ã¤ãã¦ç¥ãã¹ããããããã¨ã解説ãã¾ãã ããããâHello Worldâãã¥ã¼ããªã¢ã«ã®ãã¯ããä¸ããããã®ã§ãã ã¹ãã¼ã¿ã¹ è²´æ¹ãèªãã§ããã®ã¯ãæ¬æ¸ã®ããããæçµçã¨ãªãã¾ãã ã¤ã¾ãæ¬æ¸ã¯ãééããè¦ã¤ãã£ãå ´åãã Node.jsã®æ°ãã¼ã¸ã§ã³ã«ãããå¤æ´ç¹ãåæ ããæã®ã¿ãæ¹è¨ããã¾ãã æçµæ´æ°æ¥ã¯2012å¹´2æ12æ¥ã§ãã æ¬æ¸å ã®ã³ã¼ãã®ãµã³ãã«ã¯ãNode.jsã®ãã¼ã¸ã§ã³0.6.10ã§ãã¹ããã¦ãã¾ãã ã¿ã¼ã²ããèªè æ¬æ¸ã¯ãRubyãPythonãPHPãJavaã®ãããªãå°ãªãã¨ãã²ã¨ã¤ã®ãªãã¸ã§ã¯ãæåè¨èªãç解ãã¦ããã JavaScriptã«ã¤ãã¦ã¯ãã¾ãçµé¨ããªããNode.jsã«ã¤ãã¦ã¯å ¨ãçµé¨ããªãã¨ããã èè ã¨åããããªãã
node.jsã«é¢ããåºç¤ããã¥ã¼ããªã¢ã«ã®ã¾ã¨ãã ãªã¢ã«ã¿ã¤ã ãªWEBãå®ç¾ããã«ã¯å¿ é ã®ãµã¼ããµã¤ãJSãnode.jsã«ã¤ãã¦è²ã ã¨ã¾ã¨ãã¦ã¿ã¾ããã node.js node.jsã«ã¤ã㦠node.js ãªãã¨ãªãåããã ãã©ããåãããªãã¨ããæ¹ãå¤ããããããªãã®ã§ç°¡åã«è§£èª¬ã ä¸çªæåè¦ãæã¯ä½ãã®JavaScript ã©ã¤ãã©ãªãã¨æã£ãã®ã§ãããå ¨ãéã£ã¦ãV8ã¨ããChromeã«ãã®ã£ã¦ããé«éJavaScriptã¨ã³ã¸ã³ä¸ã§åããµã¼ããåãããä»çµã¿ã ãµã¼ãèªä½ãå ·ä½çã«è¨ãã¨æ¬¡ã®ãããªã³ã¼ãã§å®ç¾ãã¾ãã var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain
ãã¾æ³¨ç®ããã¦ãããµã¼ããµã¤ãJavaScriptã®ç«ä»ãå½¹ã¨ãªã£ãNode.jsããã®éçºè ã§ããã©ã¤ã¢ã³ã»ãã¼ã«ï¼Ryan Dahlï¼æ°èªèº«ãNode.jsãç´¹ä»ããè¬æ¼ãIntroduction to Node.js with Ryan Dahl ãã®ãããªãå ¬éããã¦ãã¾ãã ãã®è¬æ¼ã¯ããµã³ãã©ã³ã·ã¹ã³ã®PHPéçºè ã®éã¾ãã§ããThe SF PHP Meetup Groupã2æã«ãã¼ã«æ°ãæå¾ ãã¦è¡ããããã®ã ãã®ãããNode.jsãç¥ããªããããããã¼ã«åãã¦ãNode.jsãã©ã®ãããªç¹å¾´ãæã¤ããã°ã©ãã³ã°è¨èªãªã®ããåããããã解説ãã¦ãã¾ããå 容ãç´¹ä»ãã¾ãããã Node.jsã¨PHPã¨ã®æ¬è³ªçãªéãã¨ã¯ä½ã Node.jsã触ã£ã¦ã¿ãããä»æ¥ã¯ç¹ã«ã¹ã©ã¤ãã¯ç¨æãã¦ãªãã¦ãã¿ã¤ããã¦ã©ããªãã®ããåãããªããç´¹ä»ãã¦ããã¤ããã ï¼æ³¨ï¼ãã¼ã«æ°ã¯ããã§æåã«ã
æ¬ç¨¿ã§ã¯ãNode.jsã®ç¹å¾´ãåä½åçã«è§¦ãããµã³ãã«ãå½¹ã«ç«ã¤ããã±ã¼ã¸ãæ´»ç¨äºä¾ãªã©ãç´¹ä»ãããã¨æãã¾ãã 主ãªãµã¼ããµã¤ãJavaScript Node.jsã«è§¦ããåã«ãäºåç¥èã¨ãã¦ä»ã®ãµã¼ããµã¤ãJavaScriptã«ã触ãã¦ããã¾ããNode.jså«ãããµã¼ããµã¤ãJavaScriptã«ã¯ã主ã«ä»¥ä¸ã®ãããªããã¸ã§ã¯ããããã¾ãã ãµã¼ããµã¤ãJavaScripã®æ¨æºä»æ§ãCommonJSãã¨ã¯ ãµã¼ããµã¤ãJavaScriptã«ã¯ããCommonJSãã¨å¼ã°ããæ¨æºåãçå®ããã¦ãã¾ããæ¨æºåã¨ããã¨é£ããæãããã¾ãããè¦ã¯ãµã¼ããµã¤ãã§JavaScriptãå®è¡ããã®ã«ä½ãå¿ è¦ããä»æ§ã¨ãã¦ãå®ç¾©ãã¦ããããã¥ã¡ã³ãã®ãã¨ã§ãï¼ä¾ãã°ãããã°ãå¿ è¦ã ããããªã©ï¼ã Node.jsã¯ããã®CommonJSã«åã£ã¦éçºããã¦ãã¾ããç¾æ®µéã§ããã°ãCommonJSã®ä»æ§
ãã®ã»ãã·ã§ã³ã§ã¯ãååã§Nodeã®ã³ã³ã»ããããå¾åã§ã¯æ¥é±ã«ããªãªã¼ã¹äºå®ã®Nodeã®æ°ãã¼ã¸ã§ã³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ãã®ããã¹ã»ãªããã¼ã®è¨èã¯Nodeã®ç¹å¾´ã表ãã¦ãã¦ãNodeã¨ã¯æ©è½ãå ããããããããåãå»ã£ããã®ã§ãã ãã¾ã®OSã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ã»ã¨ãã©ã¯ã1970年代ã®ãã¬ããªã³ã¿ã®ãããªæ´å²ãã²ããã£ã¦ãã¾ããã±ã³ã»ãã³ãã½ã³ã¨ããã¹ã»ãªããã¼ãéçºããUNIXãCã¯å½æã®PDP11ã®ããã«ãã¶ã¤ã³ããããã®ã§ããã¾ã®OSããã®æ´å²ä¸ã«ããã®ã§ãã UNIXã®åºæ¬æ¦å¿µã¯ã対話çãªã³ãã³ãã©ã¤ã³ãä½ããã®ã§ãããlsã³ãã³ããæã¤ã¨ãã®çµæããã¬ã¿ã¤ãã«åºåãããã¨ãã£ããã®ã§ããããã¦åºæ¬æ¦å¿µã«ã¯ããããã¯ããã·ã¹ãã ã³ã¼ã«ãããã»ã¹ãå«ã¾ãã¦ãã¾ãã ãããã¯ããã·ã¹ãã ã³ã¼ã«ãå¼ã³åºãã¨ãI/Oãå®äºããã¾ã§æ»ã£ã¦ãã¾ãããæ»ã£ã¦ããã¾ã§ã©ãã ããããããåã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}