{"id":306350,"date":"2020-07-03T09:00:30","date_gmt":"2020-07-03T09:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306350"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306350","title":{"rendered":"\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Node.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445. \u0427\u0430\u0441\u0442\u044c 2"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509364\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ph\/zy\/by\/phzybyqyo4afy-fkn51qrxgqupc.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/nodejs.dev\/learn\" rel=\"nofollow\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Node.js<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/509080\/\">\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Node.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445. \u0427\u0430\u0441\u0442\u044c 1<\/a><\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u0414\u0432\u0438\u0436\u043e\u043a JavaScript V8<\/h3>\n<p><\/font><br \/>  V8 \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 JavaScript, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e Google Chrome. \u042d\u0442\u0430 \u0442\u0430 \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0435\u0442 \u0432\u0430\u0448 JavaScript-\u043a\u043e\u0434 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. <\/p>\n<p>  \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, V8 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript. DOM \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0435\u0431-API \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c. <\/p>\n<p>  \u0414\u0432\u0438\u0436\u043e\u043a JavaScript \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e Node.js. V8 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0434\u043b\u044f Node.js \u0432 2009, \u0438 \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 Node.js V8 \u0441\u0442\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e JavaScript. <\/p>\n<p>  \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 Node.js \u043e\u0433\u0440\u043e\u043c\u043d\u0430 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f V8 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Electron. <br \/>  <a name=\"habracut\"><\/a><br \/>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0414\u0440\u0443\u0433\u0438\u0435 JS \u0434\u0432\u0438\u0436\u043a\u0438<\/h5>\n<p><\/font><br \/>  \u0414\u0440\u0443\u0433\u0438\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 JavaScript-\u0434\u0432\u0438\u0436\u043a\u0438:<\/p>\n<ul>\n<li>Firefox \u2014 <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/SpiderMonkey\" rel=\"nofollow\">SpiderMonkey<\/a><\/li>\n<li>Safari \u2014 <a href=\"https:\/\/developer.apple.com\/documentation\/javascriptcore\" rel=\"nofollow\">JavaScriptCore (Nitro)<\/a><\/li>\n<li>Edge \u2014 <a href=\"https:\/\/github.com\/Microsoft\/ChakraCore\" rel=\"nofollow\">Chakra<\/a><\/li>\n<\/ul>\n<p>  \u0438 \u0442.\u0434. <\/p>\n<p>  \u0412\u043e \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 <a href=\"https:\/\/www.ecma-international.org\/publications\/standards\/Ecma-262.htm\" rel=\"nofollow\">ECMA ES-262 (ECMAScript)<\/a>, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 JavaScript. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h5>\n<p><\/font><br \/>  V8 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C++ \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. <\/p>\n<p>  \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 V8: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 <a href=\"https:\/\/v8.dev\/\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043e\u043d\u0438 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0430\u0441\u0442\u043e \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e. <\/p>\n<p>  V8 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 JavaScript-\u0434\u0432\u0438\u0436\u043a\u0438, \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0435\u0431\u0430 \u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Node.js. <\/p>\n<p>  \u0412 \u0432\u0435\u0431\u0435 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043b\u0433\u0438\u0435 \u0433\u043e\u0434\u044b, \u0438 \u043c\u044b (\u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438) \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0434. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/h5>\n<p><\/font><br \/>  JavaScript \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a, \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u044e\u0442 JavaScript, \u043e\u043d\u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442. <\/p>\n<p>  \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 2009 \u0433\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 JavaScript SpiderMonkey \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 Firefox 3.5. <\/p>\n<p>  JavaScript \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f V8 \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb (just-in-time, JIT, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f) \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0441 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c Google Maps \u0432 2004, JavaScript \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0442 \u044f\u0437\u044b\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0448\u0443\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u0434\u043e \u044f\u0437\u044b\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0438\u0437 \u0441\u043e\u0442\u0435\u043d \u0438 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. <\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0430\u0448\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0430\u043c\u0438, \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0444\u043e\u0440\u043c. <\/p>\n<p>  \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f JavaScript \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u043a\u043e\u0434\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a Node.js-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/h3>\n<p><\/font><br \/>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 Node.js \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>node<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043c\u0435\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u0430\u0448\u0435\u0433\u043e Node.js-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>app.js<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">node app.js <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c <code>app.js<\/code>. <\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u041a\u0430\u043a \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 Node.js?<\/h3>\n<p><\/font><br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Node.js-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ctrl-C<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 (\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439, \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430) \u043c\u043e\u0434\u0443\u043b\u044c <code>process<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 Node.js-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: <code>process.exit()<\/code>. <\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 Node.js \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>  \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 (\u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0435) \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 <code>stdout<\/code> \u0438\u043b\u0438 <code>stderr<\/code> \u2014 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u044b. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0443 <code>exit()<\/code> \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">process.exit(1) <\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u0434 \u0432\u044b\u0445\u043e\u0434\u0430 \u2014 0, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435. \u0420\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0432\u044b\u0445\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438. <\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0430\u0445 \u0432\u044b\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/nodejs.org\/api\/process.html#process_exit_codes\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>exitCode<\/code>:<\/p>\n<pre><code class=\"javascript\">process.exitCode = 1 <\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, Node.js \u0432\u0435\u0440\u043d\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. <\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043c\u044f\u0433\u043a\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b. <\/p>\n<p>  \u0412 Node.js \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440:  <\/p>\n<pre><code class=\"javascript\">const express = require('express') const app = express()  app.get('\/', (req, res) =&gt; {     res.send('Hi!') })  app.listen(3000, () =&gt; console.log('Server ready')) <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0435 <code>process.exit()<\/code>, \u0432\u0441\u0435 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u044b. \u042d\u0442\u043e \u043d\u0435 \u043a\u0440\u0443\u0442\u043e. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443-\u0441\u0438\u0433\u043d\u0430\u043b <code>SIGTERM<\/code> \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (<code>process<\/code> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e):  <\/p>\n<pre><code class=\"javascript\">const express = require('express')  const app = express()  app.get('\/', (req, res) =&gt; {     res.send('Hi!') })  const server = app.listen(3000, () =&gt; console.log('Server ready'))  process.on('SIGTERM', () =&gt; {     server.close(() =&gt; {         console.log('Process terminated')     }) }) <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b? \u0421\u0438\u0433\u043d\u0430\u043b\u044b \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 POSIX: \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438. <\/p>\n<p>  <code>SIGKILL<\/code> \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u043e \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 <code>process.exit()<\/code>. <\/p>\n<p>  <code>SIGTERM<\/code> \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u043e \u043c\u044f\u0433\u043a\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u042d\u0442\u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a <code>upstart<\/code>, <code>supervisord<\/code> \u0438 \u0434\u0440. <\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0447\u0435\u0440\u0435\u0437 \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"javascript\">process.kill(process.id, 'SIGTERM') <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 Node.js-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d PID \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c. <\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u041a\u0430\u043a \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u0432 Node.js?<\/h3>\n<p><\/font><br \/>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Node.js <code>process<\/code> \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>env<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. <\/p>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b NODE_ENV, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>development<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:  <\/p>\n<pre><code class=\"javascript\">process.env.NODE_ENV \/\/ development <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 production \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442 Node.js \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u0441\u0440\u0435\u0434\u0430. <\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u044e\u0431\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b. <\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Node.js REPL<\/h3>\n<p><\/font><br \/>  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>node<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Node.js-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">node script.js  <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0435\u043c \u0432 \u0440\u0435\u0436\u0438\u043c REPL:<\/p>\n<pre><code class=\"javascript\">node  <\/code><\/pre>\n<p>  REPL (Run Evaluate Print Loop, \u0446\u0438\u043a\u043b \u00ab\u0447\u0442\u0435\u043d\u0438\u0435-\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435-\u0432\u044b\u0432\u043e\u0434\u00bb) \u2014 \u044d\u0442\u043e \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 (\u043e\u0431\u044b\u0447\u043d\u043e, \u043e\u043a\u043d\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0432\u0435\u0434\u0435\u0442\u0435 <code>node<\/code> \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<pre><code class=\"javascript\">&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u043c, \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0432\u0432\u043e\u0434\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e JavaScript-\u043a\u043e\u0434\u0430. <\/p>\n<p>  \u0412\u0432\u0435\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"javascript\">&gt; console.log('test') test  undefined  &gt; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, <code>test<\/code>, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0432\u0435\u043b\u0435\u043b\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0437\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <code>undefined<\/code> \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>console.log()<\/code><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0435. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>tab<\/code> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f<\/h5>\n<p><\/font><br \/>  REPL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c <code>tab<\/code> \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, REPL \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435, \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041e\u0431\u044a\u0435\u043a\u0442\u044b JavaScript<\/h5>\n<p><\/font><br \/>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043c\u044f JavaScript-\u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Number<\/code>, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043a \u043d\u0435\u043c\u0443 \u0442\u043e\u0447\u043a\u0443 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <code>tab<\/code>. <\/p>\n<p>  REPL \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/el\/ez\/7y\/elez7ysuz1dcizthmjwpaxfuxf4.png\"><\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/h5>\n<p><\/font><br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u0432\u0435\u0434\u044f <code>global.<\/code> \u0438 \u043d\u0430\u0436\u0430\u0432 <code>tab<\/code>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zy\/fi\/hv\/zyfihvrhnt17bgboo0pcp65qkvk.png\"><\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f _<\/h5>\n<p><\/font><br \/>  \u0415\u0441\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430\u0431\u0440\u0430\u0442\u044c <code>_<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0447\u043a\u0438<\/h5>\n<p><\/font><br \/>  REPL \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438. \u0412\u043e\u0442 \u043e\u043d\u0438:<\/p>\n<ul>\n<li><code>.help<\/code> \u2014 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u043a\u043e\u043c\u0430\u043d\u0434<\/li>\n<li><code>.editor<\/code> \u2014 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e JavaScript-\u043a\u043e\u0434\u0430. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0436\u0430\u0442\u044c <code>ctrl-D<\/code><\/li>\n<li><code>.break<\/code> \u2014 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0432\u043e\u0434 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e <code>ctrl-C<\/code><\/li>\n<li><code>.clear<\/code> \u2014 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 REPL \u043a \u043f\u0443\u0441\u0442\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443, \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0435\u0441\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/li>\n<li><code>.load<\/code> \u2014 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 JavaScript-\u0444\u0430\u0439\u043b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 (\u0440\u0430\u0431\u043e\u0447\u0435\u0439) \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/li>\n<li><code>.save<\/code> \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u044e REPL \u0432 \u0444\u0430\u0439\u043b \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c<\/li>\n<li><code>.exit<\/code> \u2014 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 REPL. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0432\u043e\u0439\u043d\u043e\u043c\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u044e <code>ctrl-C<\/code><\/li>\n<\/ul>\n<p>  REPL \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 <code>.editor<\/code>. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"javascript\">[1, 2, 3].forEach(num =&gt; { <\/code><\/pre>\n<p>  \u0438 \u043d\u0430\u0436\u0430\u043b\u0438 <code>enter<\/code>, REPL \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u0440\u0435\u043c\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u0441\u043e\u043e\u0431\u0449\u0430\u044f, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u043b\u043e\u043a\u043e\u043c \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">... console.log(num) ... }) <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0432\u0435\u0434\u0435\u0442\u0435 <code>.break<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435, \u0440\u0435\u0436\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u0430 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e. <\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/h3>\n<p><\/font><br \/>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 Node.js-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u043a\u043b\u044e\u0447 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">node app.js joe <\/code><\/pre>\n<p>  \u0438\u043b\u0438 <\/p>\n<pre><code class=\"javascript\">node app.js name=joe  <\/code><\/pre>\n<p>  \u041e\u0442 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e, \u043a\u0430\u043a \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 Node.js-\u043a\u043e\u0434\u0435. <\/p>\n<p>  \u0414\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>process<\/code>. <\/p>\n<p>  \u0412 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 <code>argv<\/code> \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. <\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>node<\/code>. <\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. <\/p>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 (\u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430). <\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u0443\u0442\u044c node \u0438 \u043f\u0443\u0442\u044c \u0444\u0430\u0439\u043b\u0430) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430:<\/p>\n<pre><code class=\"javascript\">process.argv.forEach((val, index) =&gt; {     console.log(`${index}: ${val}`) }) <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432 \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0435\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const args = process.argv.slice(2) <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0431\u0435\u0437 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 (\u043a\u043b\u044e\u0447\u0430):<\/p>\n<pre><code class=\"javascript\">node app.js joe <\/code><\/pre>\n<p>  \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">const args = process.argv.slice(2) args[0] <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n<pre><code class=\"javascript\">node app.js name=joe <\/code><\/pre>\n<p>  <code>args[0]<\/code> \u2014 \u044d\u0442\u043e <code>name=joe<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c. \u041b\u0443\u0447\u0448\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/www.npmjs.com\/package\/minimist\" rel=\"nofollow\">minimist<\/a>, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">const args = require('minimist')(process.argv.slice(2)) args['name'] \/\/ joe <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u043e\u0439\u043d\u043e\u0435 \u0442\u0438\u0440\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">node app.js --name=joe <\/code><\/pre>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Node.js<\/h3>\n<p><\/font><br \/>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u044f <code>console<\/code><\/h5>\n<p><\/font><br \/>  Node.js \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"https:\/\/nodejs.org\/api\/console.html\" rel=\"nofollow\">\u043c\u043e\u0434\u0443\u043b\u044c console<\/a>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. <\/p>\n<p>  \u041e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 <code>console<\/code> \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. <\/p>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>console.log()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 \u0441\u0442\u0440\u043e\u043a\u0443. <\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <code>console.log<\/code> \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"javascript\">const x = 'x' const y = 'y' console.log(x, y) <\/code><\/pre>\n<p>  \u0438 Node.js \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043e\u0431\u0435. <\/p>\n<p>  \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432:<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">console.log('My %s has %d years', 'cat', 2) <\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><code>%s<\/code> \u2014 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443<\/li>\n<li><code>%d<\/code> \u2014 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0447\u0438\u0441\u043b\u043e<\/li>\n<li><code>%i<\/code> \u2014 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a \u0446\u0435\u043b\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443<\/li>\n<li><code>%o<\/code> \u2014 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442<\/li>\n<\/ul>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">console.log('%o', Number) <\/code><\/pre>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/h5>\n<p><\/font><br \/>  <code>console.clear()<\/code> \u043e\u0447\u0438\u0449\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u043e\u043b\u044c (\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438).<\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h5>\n<p><\/font><br \/>  <code>console.count()<\/code> \u2014 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. <\/p>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const x = 1  const y = 2  const z = 3 console.count(     'The value of x is ' + x +     ' and has been checked .. how many times?' ) console.count(     'The value of x is ' + x +     ' and has been checked .. how many times?' ) console.count(     'The value of y is ' + y +     ' and has been checked .. how many times?' ) <\/code><\/pre>\n<p>  \u0421\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. <\/p>\n<pre><code class=\"javascript\">The value of x is 1 and has been checked .. how many times?: 1 The value of x is 1 and has been checked .. how many times?: 2 The value of y is 2 and has been checked .. how many times?: 1   <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0431\u043b\u043e\u043a \u0438 \u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const oranges = ['orange', 'orange'] const apples = ['just one apple'] oranges.forEach(fruit =&gt; console.count(fruit)) apples.forEach(fruit =&gt; console.count(fruit)) <\/code><\/pre>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0435\u043a\u0430<\/h5>\n<p><\/font><br \/>  \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0438\u0442\u044c \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u041a\u0430\u043a \u043c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430?\u00bb<\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>console.trace()<\/code>:<\/p>\n<pre><code class=\"javascript\">const function2 = () =&gt; console.trace() const function1 = () =&gt; function2() function1() <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430. \u0412\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 Node.js REPL:  <\/p>\n<pre><code class=\"javascript\">Trace     at function2 (repl:1:33)     at function1 (repl:1:25)     at repl:1:1     at ContextifyScript.Script.runInThisContext (vm.js:44:33)     at REPLServer.defaultEval (repl.js:239:29)     at bound (domain.js:301:14)     at REPLServer.runBound [as eval] (domain.js:314:12)     at REPLServer.onLine (repl.js:440:10)     at emitOne (events.js:120:20)     at REPLServer.emit (events.js:210:7) <\/code><\/pre>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430<\/h5>\n<p><\/font><br \/>  \u0412\u044b \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>time()<\/code> \u0438 <code>timeEnd()<\/code>:<\/p>\n<pre><code class=\"javascript\">const doSomething = () =&gt; console.log('test') const measureDoingSomething = () =&gt; {     console.time('doSomething()')     \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u0441\u0435\u043a\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f     doSomething()     console.timeEnd('doSomething()') } measureDoingSomething() <\/code><\/pre>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>stdout \u0438 stderr<\/h5>\n<p><\/font><br \/>  \u041a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, console.log \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u042d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0438\u043b\u0438 <code>stdout<\/code>. <\/p>\n<p>  <code>console.error<\/code> \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043a <code>stderr<\/code>. <\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u043e\u0448\u0438\u0431\u043e\u043a (error log). <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0421\u0442\u0438\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u044b\u0432\u043e\u0434<\/h5>\n<p><\/font><br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/gist.github.com\/iamnewton\/8754917\" rel=\"nofollow\">\u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 (escape sequences)<\/a>. \u042d\u0442\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0446\u0432\u0435\u0442. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">console.log('\\x1b[33m%s\\x1b[0m', 'hi!') <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 Node.js REPL, \u0442\u043e <code>hi!<\/code> \u0431\u0443\u0434\u0435\u0442 \u0436\u0435\u043b\u0442\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430. <\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u0438\u0439. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/chalk\/chalk\" rel=\"nofollow\">Chalk<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0440\u043e\u043c\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u0443\u0436\u0438\u0440\u043d\u044b\u043c, \u043d\u0430\u043a\u043b\u043e\u043d\u043d\u044b\u043c \u0438\u043b\u0438 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u043c. <\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <code>npm install chalk<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">const chalk = require('chalk') console.log(chalk.yellow('hi!')) <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>chalk.yellow<\/code> \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439. \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. <\/p>\n<p>  <font color=\"#CD5C5C\"><\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430<\/h5>\n<p><\/font><br \/>  <a href=\"https:\/\/www.npmjs.com\/package\/progress\" rel=\"nofollow\">Progress<\/a> \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>npm install progress<\/code>. <\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 10 \u0448\u0430\u0433\u043e\u0432. \u041a\u0430\u0436\u0434\u044b\u0435 100 \u043c\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0448\u0430\u0433. \u041f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a: <\/p>\n<pre><code class=\"javascript\">const ProgressBar = require('progress')  const bar = new ProgressBar(':bar', { total: 10 }) const timer = setInterval(() =&gt; {     bar.tick()     if (bar.complete) clearInterval(timer) }, 100) <\/code><\/pre>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0434\u0440\u0443\u0437\u044c\u044f. \u041f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043b\u0438\u0447\u043a\u0443, \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d.<\/p>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442\u2026<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/509364\/\"> https:\/\/habr.com\/ru\/post\/509364\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509364\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ph\/zy\/by\/phzybyqyo4afy-fkn51qrxgqupc.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/nodejs.dev\/learn\" rel=\"nofollow\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Node.js<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/509080\/\">\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Node.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445. \u0427\u0430\u0441\u0442\u044c 1<\/a><\/p>\n<p>  <font color=\"#228B22\"><\/p>\n<h3>\u0414\u0432\u0438\u0436\u043e\u043a JavaScript V8<\/h3>\n<p><\/font><br \/>  V8 \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 JavaScript, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e Google Chrome. \u042d\u0442\u0430 \u0442\u0430 \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0435\u0442 \u0432\u0430\u0448 JavaScript-\u043a\u043e\u0434 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. <\/p>\n<p>  \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, V8 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript. DOM \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0435\u0431-API \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c. <\/p>\n<p>  \u0414\u0432\u0438\u0436\u043e\u043a JavaScript \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e Node.js. V8 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0434\u043b\u044f Node.js \u0432 2009, \u0438 \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 Node.js V8 \u0441\u0442\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e JavaScript. <\/p>\n<p>  \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 Node.js \u043e\u0433\u0440\u043e\u043c\u043d\u0430 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f V8 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Electron.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306350","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306350"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306350\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}