ç¹å®ã®å¿çšåé¡ã解決ããããã«æ°ãããã¯ãããžãŒã«çŽé¢ããçµéšè±å¯ãªããã°ã©ããŒã¯ãããã«å€ãã®å®çšçãªè³ªåãæèµ·ããŸãã ãã©ãããã©ãŒã ã®ã€ã³ã¹ããŒã«æ¹æ³ã¯ïŒ ã€ã³ã¹ããŒã«åŸã®å Žæãšå 容ã¯ïŒ ãããžã§ã¯ããã¬ãŒã ã¯ãŒã¯ãäœæããæ¹æ³ãã©ã®ããã«æ§é åãããŸããïŒ ã³ãŒããã¢ãžã¥ãŒã«ã«åå²ããæ¹æ³ã¯ïŒ ã©ã€ãã©ãªããããžã§ã¯ãã«è¿œå ããæ¹æ³ã¯ïŒ å¿ èŠãªæ©èœãåããæ¢è£œã®ã©ã€ãã©ãªã¯ã©ãã§å ¥æã§ããŸããïŒ ã³ãŒãããããã°ããæ¹æ³ãšå Žæ åäœãã¹ãã®æžãæ¹
ãããã®è³ªåãžã®åçã¯ãå¿ èŠã«å¿ããŠãããäžã§ç°¡åã«èŠã€ããããšãã§ããŸããã1ããŒã¹ã®èšäºãèªã¿çŽãå¿ èŠããããå質åã«ã¯ããã€ãã®åçããããŸãã ãã°ããåã«ãnode.jsã§å°ããªãã¥ãŒããªã¢ã«ãäœæããå¿ èŠããããŸããããã®ãã¥ãŒããªã¢ã«ã䜿çšãããšãéçºããã°ããéå§ãããã®æè¡ã䜿çšããŠãããžã§ã¯ãã«æ°ããããã°ã©ããŒã玹ä»ã§ããŸãã JavaScriptãçç¥ããŠããçµéšè±å¯ãªJavaéçºè åãã«èšèšãããŠããŸãããnode.jsã¯ããã¯ãšã³ããã©ãããã©ãŒã ãšããŠã¯æ°ãããã®ã§ãã
ãã®èšäºã¯ãJavaã®äžçã®éçºè ã ãã§ãªãããã©ãããã©ãŒã node.jsã䜿ãå§ãããã¹ãŠã®äººã«ãšã£ãŠã圹ç«ã€ãšæããŸãã
ã€ã³ã¹ããŒã«ãšã»ããã¢ãã
ããŒããšnpmãã€ã³ã¹ããŒã«ãã
çª
Windowsã§ã®node.jsã®ã€ã³ã¹ããŒã«ã¯ãmsiã€ã³ã¹ããŒã©ãŒã䜿çšããŠè¡ãããŸãã ããŠã³ããŒãããã«ã¯ããµã€ãhttps://nodejs.orgã«ã¢ã¯ã»ã¹ã ããã€ã³ã¹ããŒã«ããã¯ãªãã¯ããŸãã ã€ã³ã¹ããŒã©ãŒïŒnode-v0.12.4-install.msiãšããååã®ãã¡ã€ã«ïŒãããŠã³ããŒãããåŸããããå®è¡ããã€ã³ã¹ããŒã«æé ã«åŸãå¿ èŠããããŸãã
ããã©ã«ãã§ã¯ãWindowsã§ã¯ãnode.jsã¯cïŒ\ Program Files \ nodejsãã©ã«ããŒã«ã€ã³ã¹ããŒã«ãããŸãã ãŸããããã©ã«ãã§ã¯ããã¹ãŠã®ã³ã³ããŒãã³ããã€ã³ã¹ããŒã«ãããŸãïŒå®éã«ã¯ãnode.jsãnpmããã±ãŒãžãããŒãžã£ãŒãããã¥ã¡ã³ããžã®ãªã³ã¯ãããã«ãnodeããã³npmãžã®ãã¹ãPATHç°å¢å€æ°ã«æžã蟌ãŸããŸãïŒã ãã¹ãŠã®ã€ã³ã¹ããŒã«ã³ã³ããŒãã³ããéžæãããŠããããšã確èªããããšããå§ãããŸãã
OS X
OS Xã§ã¯ãããŒããã€ã³ã¹ããŒã«ããæãç°¡åãªæ¹æ³ã¯ã brew package managerã䜿çšããããšã§ãã ãããè¡ãã«ã¯ã次ã®ã³ãã³ããå®è¡ããŸãã
> brew install node
ããŒãã¯ã/ usr / local / Cellar / <version> / nodeãã©ã«ããŒã«ãäžå®ã®ã·ã³ããªãã¯ãªã³ã¯/ usr / local / opt / node /ãšãšãã«ã€ã³ã¹ããŒã«ãããŸãã
UbuntuïŒx64ïŒ
æåŸã®ãã©ã³ãïŒ0.12ïŒãã€ã³ã¹ããŒã«ããã«ã¯ããµã€ããããã£ã¹ããªãã¥ãŒã·ã§ã³ãããŠã³ããŒãããããšããå§ãããŸãã
wget http://nodejs.org/dist/v0.12.4/node-v0.12.4-linux-x64.tar.gz sudo tar -C /usr/local --strip-components 1 -xzf node-v0.12.4-linux-x64.tar.gz
é åžããã±ãŒãžã¯ãbinãincludeãlibãããã³shareãµããã©ã«ããŒã®/ usr / localãã©ã«ããŒã«è§£åãããŸãã
èšçœ®ç¢ºèª
ã€ã³ã¹ããŒã«ã確èªããã«ã¯ãã³ãã³ãã©ã€ã³ã§--versionãªãã·ã§ã³ãæå®ããŠnodeããã³npmãå®è¡ããŸãã
> node --version v0.12.4 > npm --version 2.10.1
IntelliJ IDEAã«ãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ãã
IntelliJ IDEAãå®è¡ããèšå®ã«å ¥ããŸãã
[ãã©ã°ã€ã³]ã»ã¯ã·ã§ã³ãèŠã€ããŠã[JetBrainsãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«...]ãã¯ãªãã¯ããŸãã
ãªã¹ãã§NodeJSãã©ã°ã€ã³ãèŠã€ããããã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«ããã¿ã³ãã¯ãªãã¯ããŸãã ããŠã³ããŒããå®äºãããšããã¿ã³ã¯ãIntelliJ IDEAã®åèµ·åãã«å€ãããŸããã¯ãªãã¯ããŠç°å¢ãåèµ·åããŸãã
åèµ·ååŸãèšå®ã«ç§»åãã[èšèªãšãã¬ãŒã ã¯ãŒã¯]-> [Node.jsããã³NPM]ã»ã¯ã·ã§ã³ãèŠã€ããŸãã ãããŒãã€ã³ã¿ãŒããªã¿ãŒãã»ã¯ã·ã§ã³ã«ãã€ã³ã¹ããŒã«ãããå®è¡å¯èœããŒããžã®ãªã³ã¯ãå«ãŸããŠããããšã確èªããŠãã ããã
ãnode.jsã³ã¢ã¢ãžã¥ãŒã«ã®ãœãŒã¹ãã»ã¯ã·ã§ã³ã§ããæ§æããã¿ã³ãã¯ãªãã¯ããŸãã 衚瀺ããããŠã£ã³ããŠã§ããã€ã³ã¿ãŒãããããããŠã³ããŒãããéžæãããæ§æããã¯ãªãã¯ããŸããnode.jsã®ãœãŒã¹ã³ãŒããããŠã³ããŒããããã€ã³ããã¯ã¹ãäœæãããŸãã ããã«ãããéçºäžã«ãœãŒã¹ã³ãŒãã衚瀺ã§ããŸãã
ããã±ãŒãžã»ã¯ã·ã§ã³ã«ã¯ã ã°ããŒãã«ã«ã€ã³ã¹ããŒã«ãããããã±ãŒãžã衚瀺ãããŸãïŒãã°ããŒãã«ããã±ãŒãžãã»ã¯ã·ã§ã³ãåç §ïŒã ãã®ãŠã£ã³ããŠã§ã¯ããããã®ããã±ãŒãžãè¿œå ãåé€ãæŽæ°ã§ããŸãã ããã±ãŒãžåã®æšªã«éãç¢å°ã衚瀺ãããŠããå Žåãã¢ããããŒããå©çšå¯èœã§ãã ã°ããŒãã«ã«ããŠãŒãã£ãªãã£ããã±ãŒãžã®ã¿ãã€ã³ã¹ããŒã«ããããšããå§ãããŸãã
æåã®ã¹ããã
Hello Worldãæžã
ã³ã³ãœãŒã«ã«å¯Ÿå¿ããè¡ã圢æããŠè¡šç€ºããapp.jsãã¡ã€ã«ãäœæããŸãã
// app.js var greeting = 'hello'; greeting += ' world!'; console.log(greeting);
次ã®ã³ãã³ãã§å®è¡ããŸãïŒ
> node app.js hello world!
REPLã䜿çšããŸã
åŒæ°ãªãã§nodeã³ãã³ããå®è¡ãããšããã©ãŠã¶ãŒããŒã¹ã®JSã³ã³ãœãŒã«ã«äŒŒãREPLã«ãŒãã«å ¥ãããšãã§ããŸãã ãã®äžã§ãã³ãŒããã©ã°ã¡ã³ããå®è¡ããã³ãã§ãã¯ã§ããŸãã
> node > console.log('hello world!') hello world! undefined > [1, 2, 3].reduce(function(sum, item){return sum + item}, 0) 6
å®äºããåè¡ã«ã¯ãã³ã³ãœãŒã«ã«ã衚瀺ãããæ»ãçµæããããŸãã console.logïŒïŒé¢æ°ã¯çµæãè¿ããªããããåŒã³åºããåŸãã³ã³ãœãŒã«ã«ãundefinedãã衚瀺ãããŸãã
REPLã³ã³ãœãŒã«ã§ã¯ãTabããŒãæŒããšèªåè£å®ãæ©èœããŸãã ããšãã°ããconsoleããšèšè¿°ããå ŽåãTabããŒãæŒããšãã³ã³ãœãŒã«ãªããžã§ã¯ãã®å±æ§ãšæ©èœã®ãªã¹ãã衚瀺ãããŸãã
> console. console.__defineGetter__ console.__defineSetter__ console.__lookupGetter__ console.__lookupSetter__ console.__proto__ console.constructor console.hasOwnProperty console.isPrototypeOf console.propertyIsEnumerable console.toLocaleString console.toString console.valueOf console.assert console.dir console.error console.info console.log console.time console.timeEnd console.trace console.warn console.Console console._stderr console._stdout console._times > console.
ã³ã³ãœãŒã«ãçµäºããã«ã¯ãCtrl + DãæŒããŸãã
npmã䜿çšãã
ãããžã§ã¯ãã®åæå
ãããžã§ã¯ããåæåããã«ã¯ãå°æ¥ã®ãããžã§ã¯ãã®ã«ã¿ãã°ã§npm initã³ãã³ããå®è¡ããå¿ èŠãªããŒã¿ãã€ã³ã¿ã©ã¯ãã£ãã¢ãŒãã§å ¥åããŸãïŒããããããããã©ã«ãèšå®ãæäŸãããŠãããããEnterããŒãæŒãã ãã§ãïŒã
> npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help json` for definitive documentation on these fields and exactly what they do. Use `npm install <pkg> --save` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. name: (nodetest) version: (1.0.0) description: my first node application entry point: (index.js) app.js test command: git repository: keywords: author: license: (ISC) About to write to ***\package.json: { "name": "nodetest", "version": "1.0.0", "description": "my first node application", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" } Is this ok? (yes)
ãŠãŒãã£ãªãã£ã®æåŸã«ããããžã§ã¯ãã®æ§æãèšè¿°ããpackage.jsonãã¡ã€ã«ãçŸåšã®ãã£ã¬ã¯ããªã«äœæãããŸãã ãŸãããããžã§ã¯ãã®äŸåé¢ä¿ã«é¢ããæ å ±ãä¿åãããŸãã
ãããžã§ã¯ããžã®äŸåããã±ãŒãžã®è¿œå
ãããžã§ã¯ãã«äŸåé¢ä¿ãã€ã³ã¹ããŒã«ããã«ã¯ãnpm installã³ãã³ãã䜿çšããŸãã ãã®å Žåãnode_modulesãã©ã«ããŒã¯çŸåšã®ãã£ã¬ã¯ããªã«äœæãããããã«ããŠã³ããŒããããããã±ãŒãžãé 眮ãããŸãã --saveã¹ã€ããã¯ããã®äŸåé¢ä¿ã«é¢ããæ å ±ãpackage.jsonã«è¿œå ãããããšãæå³ããŸãã ããšãã°ããã®ã³ã°çšã«log4jsããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
> npm install --save log4js log4js@0.6.25 node_modules/log4js âââ async@0.2.10 âââ underscore@1.8.2 âââ semver@4.3.4 âââ readable-stream@1.0.33 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
ãã®ã³ãã³ããå®è¡ãããšãnode_modules \ openãã©ã«ããŒãçŸåšã®ãã£ã¬ã¯ããªã«è¡šç€ºãããpackage.jsonãã¡ã€ã«ã«ãšã³ããªãè¿œå ãããŠããããšãããããŸãã
"dependencies": { "log4js": "0.6.25" }
äŸåé¢ä¿ã¬ã³ãŒããpackage.jsonãã¡ã€ã«ã«æåã§è¿œå ããããšãã§ããŸããããã®åŸãnpm installãå®è¡ããŠãæå®ãããäŸåé¢ä¿ãnode_modulesãã£ã¬ã¯ããªã«ããŒãããå¿ èŠããããŸãã
ã°ããŒãã«ããã±ãŒãž
ããã±ãŒãžã¯ããããžã§ã¯ããã£ã¬ã¯ããªãšã°ããŒãã«ã®äž¡æ¹ã«ã€ã³ã¹ããŒã«ã§ãããã¹ãŠã®ãããžã§ã¯ãã«è¡šç€ºãããŸãã ååãšããŠãboweräŸåé¢ä¿ç®¡çãŠãŒãã£ãªãã£ãgulpããã³gruntã³ã³ãã€ã©ãproject expressor express express-generatorãªã©ããŠãŒãã£ãªãã£ã§ããããã±ãŒãžã®ã¿ãã°ããŒãã«ã«ã€ã³ã¹ããŒã«ãããŸãã
ã°ããŒãã«ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŸãã
- Windows 8ã§ã¯ãïŒ USERPROFILEïŒ \ AppData \ Roaming \ npm \ node_modulesã§ã
- OS Xã§ã¯ã/ usr / local / lib / node_modulesã§ã
- Ubuntuã§ã¯ã/ usr / local / lib / node_modulesã«ãããŸãã
ããã±ãŒãžãã°ããŒãã«ã«ã€ã³ã¹ããŒã«ããã«ã¯ã-gã¹ã€ãããæå®ããŠnpmã³ãã³ããå®è¡ããŸãã
npm install -g grunt
IntelliJ IDEAã§ã®ä»äº
ãããžã§ã¯ãã®éå§
node.jsã§ãããžã§ã¯ããéãã«ã¯ãpackage.jsonãå«ããã©ã«ããŒãéããŸãã
ã¹ã¿ãŒãã¢ããæ§æèšå®
IntelliJ IDEAã§èµ·åããã³ãããã°ããã«ã¯ãèµ·åæ§æãäœæããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãå®è¡->å®è¡æ§æã«ç§»åããå·Šäžé ã®ãã©ã¹èšå·ãã¯ãªãã¯ããŠãnode.jsãéžæããŸãã
[åå]ãã£ãŒã«ããš[JavaScriptãã¡ã€ã«]ãã£ãŒã«ãã«å ¥åããŸãã
ããã§ãããŒã«ããŒã®å¯Ÿå¿ãããã¿ã³ã䜿çšããŠãã¹ã¯ãªãããéåžžã¢ãŒããšãããã°ã¢ãŒãã§å®è¡ã§ããŸãã
ãããã°
ãããã°ããã«ã¯ãäœæããæ§æããããã°ã¢ãŒãã§å®è¡ããå¿ èŠããããŸãã åæã«ãè¡ã«ãã¬ãŒã¯ãã€ã³ããèšå®ããè¡ã«æ²¿ã£ãŠãã¹ãããããå®è¡ããã³ãŒã«ã¹ã¿ãã¯ã®å 容ãçŸåšã®ã³ã³ããã¹ãã®å€æ°ã®å€ã確èªãããããã°ã¢ãŒãã§æåŸ ãããä»ã®ãã¹ãŠãå®è¡ã§ããŸãã
node.jsã®ã¢ãžã¥ãŒã«æ§
Javaã§ã¯ãã¢ãžã¥ãŒã«æ§ã®åäœã¯ããã±ãŒãžãšã¯ã©ã¹ã§ãã node.jsã®ã¢ãžã¥ãŒã«æ§ã®åäœã¯ãã¡ã€ã«ã§ãã ããã¢ãžã¥ãŒã«ãå¥ã®ã¢ãžã¥ãŒã«ã«ã€ã³ããŒãããããã«ãã¢ãžã¥ãŒã«ã¯ããŒã«ã«ïŒã€ãŸããåã¢ãžã¥ãŒã«ã§æé»çã«å®çŸ©ãããïŒé¢æ°requireïŒïŒã䜿çšããŸãã node_modulesã«ã€ã³ã¹ããŒã«ãããæšæºã¢ãžã¥ãŒã«ãŸãã¯ããã±ãŒãžã¯ãåçŽãªååã§ã€ã³ããŒãã§ããŸãã
var http = require('http');
httpã¢ãžã¥ãŒã«ã«ãã£ãŠãšã¯ã¹ããŒãããããªããžã§ã¯ãã¯ãhttpå€æ°ã«é 眮ãããŸãã
æšæºã¢ãžã¥ãŒã«ã§ã¯ãªãããããžã§ã¯ãã¢ãžã¥ãŒã«ã®1ã€ãå¥ã®ã¢ãžã¥ãŒã«ã«ã€ã³ããŒãããå ŽåãrequireïŒïŒé¢æ°ã®åŒæ°ã«ã¯ãçŸåšã®ã¢ãžã¥ãŒã«ã«é¢é£ããã¢ãžã¥ãŒã«ã®å ŽæïŒ.jsæ¡åŒµåãã«ãŠã³ãããªãïŒãå«ããå¿ èŠããããŸãã次ã«äŸã瀺ããŸãã
// myproject/somedir/mymodule1.js mymodule2 = require('../anotherdir/mymodule2'); mymodule2.fun();
// myproject/anotherdir/mymodule2.js module.exports.fun = function() { console.log('hello world!'); }
ã¢ãžã¥ãŒã«ãã¡ã€ã«ã§å®£èšãããŠãããã®ã¯ãã¹ãŠãã¢ãžã¥ãŒã«ãã¡ã€ã«å ã§ã®ã¿è¡šç€ºãããŸã-æ瀺çã«ãšã¯ã¹ããŒãããå Žåãé€ããŸãã ããšãã°ããã©ãŠã¶ã®JavaScriptãšã¯ç°ãªãããããã¬ãã«ã§å®£èšãããå€æ°ã®ã¹ã³ãŒãã¯ã宣èšãããŠããã¢ãžã¥ãŒã«ã«å¶éãããŸãã
// mymodule.js var enterprise = 'bloody';
ãšã³ã¿ãŒãã©ã€ãºå€æ°ã¯ãmymodule.jsã¢ãžã¥ãŒã«å ã§ã®ã¿è¡šç€ºãããŸãã
ã¢ãžã¥ãŒã«ããäœãããšã¯ã¹ããŒãããã«ã¯ãä»»æã®ã¢ãžã¥ãŒã«ã§äœ¿çšå¯èœãªmodule.exportså±æ§ã䜿çšã§ããŸããããã©ã«ãã§ã¯ç©ºã®ãªããžã§ã¯ããå«ãŸããŠããŸãã ãããžã®ççž®ãªã³ã¯ã䜿çšããããšãã§ããŸã-ã¢ãžã¥ãŒã«ããŒã«ã«å€æ°ã®ãšã¯ã¹ããŒãã ã¢ãžã¥ãŒã«ã®ååãæž¡ãããrequireïŒïŒé¢æ°ã¯ãmodule.exportsã«å ¥ãããã®ãè¿ããŸãã ãããã£ãŠããã®ãããªãªããžã§ã¯ããããã«é 眮ãããšïŒ
// mymodule.js module.exports = { fun: function() { console.log('hello world!'); } }
ããã¯ãŸãã«requireé¢æ°ãè¿ããã®ã§ãå¥ã®ã¢ãžã¥ãŒã«ã§åŒã³åºãããŸãïŒ
// mymodule-client.js mymodule = require('./mymodule'); mymodule.fun();
çµæã®mymoduleãªããžã§ã¯ãã¯ãã¢ãžã¥ãŒã«ã®module.exportså±æ§ã«å²ãåœãŠãããfuné¢æ°ãæã€åããªããžã§ã¯ãã§ãã
ãã ããåæ§ã®æ¹æ³ã§ããšã¯ã¹ããŒãã¯å€±æããŸãã
// mymodule.js exports = { fun: function() { console.log('hello world!'); } }
ããã¯ãmodule.exportså±æ§ãåžžã«ã¢ãžã¥ãŒã«ãããšã¯ã¹ããŒããããããã§ãã ççž®ããããšã¯ã¹ããŒããªã³ã¯ãå¥ã®ãªããžã§ã¯ãã«çœ®ãæãããã®å±æ§ã¯å€æŽããŸããã§ããã ãšã¯ã¹ããŒãã®ççž®ãªã³ã¯ã¯ãç¹å®ã®æ©èœãŸãã¯å±æ§ããšã¯ã¹ããŒãããããã«ã®ã¿äœ¿çšã§ããŸãã
// mymodule.js exports.fun = function() { console.log('hello world!'); }
// mymodule-client.js require('./mymodule').fun();
ãã¹ãäž
ã¢ã«
ãããžã§ã¯ãã«åäœãã¹ããè¿œå ããã«ã¯ã Mochaãã¬ãŒã ã¯ãŒã¯ããå§ããã®ãæåã§ãã ã°ããŒãã«npmã¢ãžã¥ãŒã«ãšããŠã€ã³ã¹ããŒã«ãããŸãã
npm install -g mocha
æãåçŽãªé¢æ°ã䜿çšããŠã¢ãžã¥ãŒã«ããã¹ãããŸãã
// mymodule.js exports.fun = function(name) { return ', ' + name + '!'; }
Mochaãã¹ãã¯ãããã©ã«ãã§testãµããã©ã«ããŒã«ãããŸãã
// test/mymodule-test.js var assert = require('assert'); var mymodule = require('../mymodule'); describe('mymodule', function() { describe('#fun()', function() { it(' , ', function() { assert.equal(mymodule.fun(''), ', !'); }); }); });
describeé¢æ°ã®æåã®åŒæ°ã¯ããã¹ã察象ã®é¢æ°ãŸãã¯ã¢ãžã¥ãŒã«ã®åäœã«é¢ãã人éãèªã¿åãã説æã§ããããã¹ãã®å®è¡æã«ã³ã³ãœãŒã«ã«è¡šç€ºãããŸãã ããã§ã¯ãããã€ãã®æ§é äžã®èŠåã«åŸãããšããå§ãããŸããããšãã°ãæåã®èšè¿°ã§ã¯ã¢ãžã¥ãŒã«ã®ååãèšè¿°ããå²ãŸããååã§ãã¹ãããé¢æ°ã®ååãèšè¿°ããŸãã mochaãå®è¡ããæ©èœãã¹ãã«åæ Œããããšã確èªããŸãã
> mocha mymodule #fun() â , 1 passing (7ms)
IntelliJ IDEAã§Mochaã䜿çšãã
Mochaã¯ããœãŒã¹ãç£èŠããã³ãŒããå€æŽããããšãã«ãã¹ããèªåçã«å®è¡ããæ¹æ³ãç¥ã£ãŠããŸãã --watch launchãªãã·ã§ã³ã䜿çšããŠãã³ãã³ãã©ã€ã³ãããã®ã¢ãŒãã§èµ·åããããšãã§ããŸãããIntelliJ IDEAã§ã¯ãŒã¯ãããŒãæ§ç¯ããŠãããããããã«ã¯ç¹å¥ãªèµ·åæ§æã䜿çšããŸãã
ã¹ã¿ãŒãã¢ããæ§æèšå®ãŠã£ã³ããŠã§ããã®æ§æã®ååïŒååïŒãšãã¹ããã©ã«ããŒïŒãã¹ããã£ã¬ã¯ããªïŒãžã®ãã¹ãæå®ããŸãã èšå®ãä¿åããŸãã
é¢æ°ã³ãŒããå€æŽããŠãã¹ããªãããã«ããMochaèµ·åæ§æãå®è¡ïŒå®è¡ïŒããŸãã
衚瀺ãããããã«ã®[èªåãã¹ãã®åãæ¿ã]ãã¿ã³ãã¯ãªãã¯ããŸãã ãã®ãã¿ã³ã¯ããœãŒã¹ãå€æŽãããšãã«ãã¹ãã®èªåå®è¡ãæå¹ã«ããŸãã
é¢æ°ã³ãŒããä¿®æ£ããŸãããMochaã¯èªåçã«ãã¹ããå®è¡ãããã¹ãŠãæ£åžžã§ããããšã瀺ããŸãã
è³æº
- node.jsã®ããã¥ã¡ã³ãã¯äž»ãªæ å ±æºã§ãããäžéšã®å Žæã§ã¯ãæšæºã¢ãžã¥ãŒã«ãäžå¿ã«ç°¡æœã§æ§é åãããŠããŸãã
- Npm Webãªããžã㪠-ã©ã€ãã©ãªããããã«é¢ããæ å ±ãæ€çŽ¢ããŸãã
- node.jsã®çŽ æŽããããªã¹ãã¯ãnode.jsã®å®çžŸã®ããã©ã€ãã©ãªãšéçºãœãªã¥ãŒã·ã§ã³ã«é¢ããäžå¯æ¬ ãªæ å ±æºã§ãã
- å®çšŒåç°å¢ã§node.jsã䜿çšããããã®ãã©ã¯ãã£ã¹ -node.jsã®ãµããŒãã«åŸäºããJoyent瀟ã®æ å ±ããŒã¿ã«ã