2013.01.27追è¨
ææ°çã§åä½ããããè¨äºãä¿®æ£ãã¾ããã
ã¯ããã«
ãã®è¨äºã§ã¯ãMac OS X Lionä¸ã«node-inspectorã¨node.jsãã¤ã³ã¹ãã¼ã«ããnode.jsããããã°ï¼ã¹ãããå®è¡ï¼ããæé ã«ã¤ãã¦æ¸ãã¦ãã¾ãã
ãã®è¨äºãæ¸ãã«ãããã以ä¸ã®ã¨ã³ããªãåèã«ããã¦ããã ãã¾ããã
- node.jsã§ã®ãããã°æ¹æ³ - ãã«ãºã£ã¨
- node.jsã®éçºæã«å½¹ç«ã¤ã¢ã¸ã¥ã¼ã« : ã¢ã·ã¢ã«ããã°
ã½ãããã³ã¯ã¯ãªã¨ã¤ãã£ã
売ãä¸ãã©ã³ãã³ã°: 13,297
node-inspector
node-inspectorã¯ããµã¼ããµã¤ãã®JavaScriptããã©ã¦ã¶ä¸ï¼Webkitç³»ã®ãã©ã¦ã¶ï¼ã§ãããã°ã§ããããã«ãã¦ãããã©ã¤ãã©ãªã§ãã
node-inspectorã£ã¦ã®ããã£ã¦ããããããã¨
chromeä¸ï¼webkitç³»ãªãããããããï¼ã§ã¯ã©ã¤ã¢ã³ããµã¤ãã®jsãããã°ã¿ããã«
ãµã¼ããµã¤ãã®jsããããã°ã§ããã
ã§ãnode.js0.3以ä¸ããªãã¨åããªãã®ã§æ³¨æã
node.jsã§ã®ãããã°æ¹æ³ - ãã«ãºã£ã¨
åä½ç°å¢
- Mac OS X Lion
- node.js 0.8.18
- [email protected]
- [email protected]
- Google Chrome 24.0.1312.56
node.jsã®ã¤ã³ã¹ãã¼ã«
node.jsã®ã¤ã³ã¹ãã¼ã«ã«é¢ãã¦ã¯ããã¡ãã®ã¨ã³ããªãåç §ãã¦ãã ããã
npmã®ã¤ã³ã¹ãã¼ã«
node.jsã®ããã±ã¼ã¸ç®¡çã·ã¹ãã npmãã¤ã³ã¹ãã¼ã«ãã¾ãã
sudo curl https://npmjs.org/install.sh | sudo sh
node-inspectorã®ã¤ã³ã¹ãã¼ã«
npmã使ã£ã¦node-inspectorãã¤ã³ã¹ãã¼ã«ãã¾ããç¾å¨ã®ææ°çã§ãã0.1.10ãå ¥ãã¦ã¿ã¾ãã
sudo npm install -g node-inspector >[email protected] /usr/local/lib/node_modules/node-inspector >âââ [email protected] >âââ [email protected] ([email protected], [email protected], [email protected]) >âââ [email protected] ([email protected], [email protected], [email protected], [email protected])
ãµã³ãã«ã³ã¼ããç¨æãã
以ä¸ã®ã³ã¼ããhelloworld.jsã¨ããååã§ä»»æã®ãã©ã«ãã«ã³ãã¼ãã¾ãã
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/');
node-inspectorã®èµ·å
以ä¸ã®ã³ãã³ãã§node-inspectorãèµ·åãã¾ãã
node-inspector > info - socket.io started >visit http://0.0.0.0:8080/debug?port=5858 to start debugging
node.jsããããã°ã¢ã¼ãã§åãã
ã¿ã¼ããã«ããã1æèµ·åãã¦ãnode.jsããããã°ã¢ã¼ãã§èµ·åãã¾ãããã®ã¨ããã«ã¬ã³ããã£ã¬ã¯ããªã¯helloworld.jsãæ ¼ç´ãããã£ã¬ã¯ããªã«ãã¾ãã
node --debug helloworld.js >debugger listening on port 5858 >Server running at http://127.0.0.1:1337/
ãããã°ãã¦ã¿ã
1. Google Chromeãèµ·åãã¦ãhttp://0.0.0.0:8080/debug?port=5858ã«ã¢ã¯ã»ã¹ãã¾ããGoogle Chromeã®Inspectorãèµ·åããã®ã§ãããã»ã©ä½æããhelloworld.jsãé¸æãã¾ãã
2. helloworld.jså
ã«ãã¬ã¼ã¯ãã¤ã³ããè¨å®ãã¾ããè¡çªå·ã®ããããã¯ãªãã¯ããã¨ãã¬ã¼ã¯ãã¤ã³ããè¨å®ã§ãã¾ãã
3. Google Chromeã®ã¿ãããã1æéããhttp://127.0.0.1:1337/ã«ã¢ã¯ã»ã¹ãã¾ããããã¨ã1æç®ã®ã¿ãã§ã¹ã¯ãªããããã¬ã¼ã¯ãã¤ã³ãã§ã¹ããããã¦ãã¹ãããå®è¡ãããã¨ãã§ããããã«ãªãã¾ãã
é¢é£ã¨ã³ããª
- node.jsã®npmã§ã«ã©ãã«ãªã¯ãªã¹ãã¹ããªã¼ãæãããã
- ãåå¿è åããnode.js(0.8) + socket.io(0.9x)ã®ãµã³ãã«ããã°ã©ã
- node.js + socket.ioã§Twitterã®Streaming APIã使ã£ã¦ã¿ã
- Ubuntu 11.10ã«node.jsãã¤ã³ã¹ãã¼ã«ãã¦åããã¦ã¿ããã
- Mac OS X Lionã«npm(Node Package Manager)ãã¤ã³ã¹ãã¼ã«ãã