{"id":190700,"date":"2013-08-20T16:40:06","date_gmt":"2013-08-20T12:40:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=190700"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=190700","title":{"rendered":"<span class=\"post_title\">YAMD: \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 JS<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0441\u0442\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 JS, \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 (~5K SLoC). \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b <a href=\"http:\/\/requirejs.org\/\">AMD<\/a> \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0448\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0448\u044c \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043b\u043e\u0433\u0438\u043a\u0443\u2026 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. \u041d\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AMD \u0438\u043b\u0438 <a href=\"http:\/\/en.wikipedia.org\/wiki\/CommonJS\">CommonJS<\/a> \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <u>\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0432\u044f\u0437\u043e\u043a<\/u> (boilerplate), \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 <u>\u0447\u0430\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b<\/u>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 JS \u2014 <a href=\"https:\/\/github.com\/rystsov\/yamd\">YAMD<\/a>.<\/p>\n<p>  <i>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u042d\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0430 AMD \u0438\u043b\u0438 CommonJS, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e AMD, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e, \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e YAMD. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, YAMD \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u043e\u0435\u0434\u0438\u043d\u043e.<\/i><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u0434\u0445\u043e\u0434. \u041e\u0442 \u0432\u0430\u0441 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0447\u0442\u043e \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0434\u043b\u044f \u0442\u0435\u0445 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447.<a name=\"habracut\"><\/a><\/p>\n<h3>YAMD<\/h3>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f JavaScript. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 CommonJS \u0438 AMD:  <\/p>\n<ul>\n<li>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0431\u0432\u044f\u0437\u043e\u043a (boilerplate code)<\/li>\n<li>\u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043d\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/li>\n<li>\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e) \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u044c Java\/C#<\/li>\n<li>\u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0430 \u043d\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/li>\n<\/ul>\n<p>  YAMD \u2014 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0435\u0451 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u043e\u0435\u0434\u0438\u043d\u043e. \u0424\u0430\u0439\u043b \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u043a\u0430\u043a IIFE, \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0434\u043d\u043e \u0438\u043c\u044f (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438), \u0442\u0430\u043a \u0432 \u0432\u0438\u0434\u0435 CommonJS \u0438\u043b\u0438 AMD \u043e\u0431\u0435\u0440\u0442\u043a\u0438.<\/p>\n<p>  \u042f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 YAMD \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c YAMD \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043a\u043e\u0433\u0434\u0430:  <\/p>\n<ul>\n<li>\u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/li>\n<li>\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/li>\n<\/ul>\n<p>  \u041c\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0449\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 YAMD \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u0440\u043e\u0441\u0441 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 AMD \u0438 CommonJS.<\/p>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 YAMD, AMD \u0438 CommonJS<\/h3>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 YAMD, AMD \u0438 CommonJS. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. <\/p>\n<p>  \u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">&gt; find . .\/math .\/math\/multiply.js .\/math\/add.js<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438:  <\/p>\n<table>\n<tr>\n<td>AMD<\/td>\n<td>CommonJS<\/td>\n<td>YAMD<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">.\/math\/add.js  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">define([], function() { return function(a,b) {   return a + b; }; });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">function add(a, b) {   return a + b; } module.exports = add;<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">expose(add); function add(a, b) {   return a + b; }<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">.\/math\/multiply.js  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">define( [&quot;math\/adding&quot;],  function(adding) { return function(a,b) {   var result = 0;   for (var i=0;i&lt;a;i++) {     result = adding(result, b);   }   return result; }; });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">var add = require('.\/add'); function multiply(a,b) {   var result = 0;   for (var i=0;i&lt;a;i++) {     result = add(result, b);   }   return result; } module.exports = multiply;<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">expose(multiply); function multiply(a,b) {   var result = 0;   for (var i=0;i&lt;a;i++) {     result = root.add(result, b);   }   return result; }<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">USAGE (assuming all dependencies are included)  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">require( [&quot;math\/add&quot;, &quot;math\/multiply&quot;],  function(add, multiply) {   console.info(add(2,7));   console.info(multiply(2,7)); });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">var multiply = require(&quot;.\/math\/multiply&quot;); var add = require(&quot;.\/math\/add&quot;); console.info(add(7,2)); console.info(multiply(7,2));<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">console.info(math.add(7,2)); console.info(math.multiply(7,2));<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<p>  AMD \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, CommonJS \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043a\u043e\u043b-\u0432\u043e \u043e\u0431\u0432\u044f\u0437\u043e\u043a \u0437\u0430 \u0441\u0447\u0435\u0442 \u043d\u0435\u044f\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0430 YAMD \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434 \u2014 \u0432\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u0440\u0435\u043d\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>root<\/code>, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u0439 \u0435\u0451 \u0447\u0430\u0441\u0442\u0438 \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430.<\/p>\n<h3>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 YAMD<\/h3>\n<p>  \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u043e\u0439 \u0432 YAMD \u0441\u0442\u0438\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>python yamd.py path\/to\/library<\/code> \u2014 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>nameOfTheLibrary.js<\/code>. \u0418\u043c\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e \u0438\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (\u0435\u0441\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0432 CommonJS \u0438\u043b\u0438 AMD \u043c\u043e\u0434\u0443\u043b\u044c). <\/p>\n<p>  \u0418\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 js-\u0444\u0430\u0439\u043b\u043e\u0432 (\u0434\u043e &quot;.js&quot;) \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u043c\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 JS.<\/p>\n<p>  \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0437\u0430\u0434\u0430\u0435\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0430 js-\u0444\u0430\u0439\u043b\u044b \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 (\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c\u0438) \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 Java \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 C#. <\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e js-\u0444\u0430\u0439\u043b (\u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0434\u043e .js \u0437\u0430\u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u043d\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043b\u044e\u0431\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>add<\/code>, \u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c `expose` \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, `expose(add);`. \u0412\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u0438 \u0432\u0438\u0434\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u2014 <code>expose(add);<\/code>, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043c\u0430\u0433\u0438\u044f YAMD, \u0430 \u043b\u0435\u0433\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f JS \u2014 <a href=\"http:\/\/www.adequatelygood.com\/JavaScript-Scoping-and-Hoisting.html\">hoisting<\/a>. \u041d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b <code>expose<\/code> \u0448\u043b\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0434\u043e \u0435\u0451 \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a <code>root<\/code>.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 (\u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430) \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043a\u043e\u0434\u0443:  <\/p>\n<pre><code class=\"javascript\">var math = (function(){     var root = {         add: function(a, b) {             return a + b;         },         multiply: function(a,b) {             var result = 0;             for (var i=0;i&lt;a;i++) {                 result = root.add(result, b);             }             return result;         }     };     return root; })();<\/code><\/pre>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0451 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0435\u043e\u0440\u0432\u0435\u0440\u0430. \u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0438\u0445 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c (\u043a\u0430\u0442\u0430\u043b\u043e\u0433), \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">&gt; find . .\/math .\/math\/multiply.js .\/math\/add.js .\/math\/distributions .\/math\/distributions\/normal.js .\/math\/distributions\/bernoulli.js<\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434  <\/p>\n<pre><code class=\"javascript\">var math = (function(){     var root = {         add: function(a, b) {             return a + b;         },         multiply: function(a,b) {             var result = 0;             for (var i=0;i&lt;a;i++) {                 result = root.add(result, b);             }             return result;         },         distributions: {             normal: function() {                  throw new Error(&quot;TODO&quot;);             },             bernoulli: function() {                  throw new Error(&quot;TODO&quot;);             }         }     };     return root; })();<\/code><\/pre>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a `expose`, \u043f\u043e\u043c\u0438\u043c\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0438\u0441\u043b\u0430 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432 \u0432\u0441\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0440\u043d\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433:  <\/p>\n<pre><code class=\"javascript\">\/\/ FILE .\/math\/distributions.js expose({normal: normal, bernoulli: bernoulli}); function normal() {      throw new Error(&quot;TODO&quot;); } function bernoulli() {      throw new Error(&quot;TODO&quot;); }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b.<\/p>\n<h3>\u0412\u0437\u0430\u0438\u043c\u043d\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/h3>\n<p>  \u0412 YAMD \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u0442\u0430 \u043f\u0435\u0440\u0432\u0443\u044e. \u0412\u043f\u0440\u043e\u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 CommonJS \u0438 AMD \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043b-\u0432\u0435 \u043a\u043e\u0434\u0430. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0449\u0443\u044e \u043a\u043e\u043b-\u0432\u043e \u0448\u0430\u0433\u043e\u0432 \u0432 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%93%D0%B8%D0%BF%D0%BE%D1%82%D0%B5%D0%B7%D0%B0_%D0%9A%D0%BE%D0%BB%D0%BB%D0%B0%D1%82%D1%86%D0%B0\">\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u041a\u043e\u043b\u043b\u0430\u0442\u0446\u0430<\/a>. \u041a\u0430\u043a \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 AMD, CommonJS \u0438 YAMD:  <\/p>\n<pre><code class=\"bash\">&gt; find math\/collatz math\/collatz math\/collatz\/steps.js math\/collatz\/inc.js math\/collatz\/dec.js<\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434:  <\/p>\n<table>\n<tr>\n<td>AMD<\/td>\n<td>CommonJS<\/td>\n<td>YAMD<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">.\/math\/collatz\/steps.js  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">define( [&quot;require&quot;, &quot;math\/collatz\/inc&quot;, &quot;math\/collatz\/dec&quot;], function(require, inc, dec) {   return function(n) {     if (n==1) return 0;     if (n%2==0) return require(&quot;math\/collatz\/dec&quot;)(n);     if (n%2==1) return require(&quot;math\/collatz\/inc&quot;)(n);   }; });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">function steps(n) {   if (n==1) return 0;   if (n%2==0) return require('.\/dec')(n);   if (n%2==1) return require('.\/inc')(n); } module.exports = steps;<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">expose(steps); function steps(n) {   if (n==1) return 0;   if (n%2==0) return root.collatz.dec(n);   if (n%2==1) return root.collatz.inc(n); }<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">.\/math\/collatz\/inc.js  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">define( [&quot;require&quot;, &quot;math\/collatz\/steps&quot;], function(require, steps) {   return function(n) {     return require(&quot;math\/collatz\/steps&quot;)(3*n+1)+1;   }; });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">function inc(n) {   return require('.\/steps')(3*n+1)+1; } module.exports = inc;<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">expose(inc) function inc(n) {   return root.collatz.steps(3*n+1)+1; }<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">.\/math\/collatz\/dec.js  <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><code class=\"javascript\">define( [&quot;require&quot;, &quot;math\/collatz\/steps&quot;], function(require, steps) {   return function(n) {     return require(&quot;math\/collatz\/steps&quot;)(n\/2)+1;   }; });<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">function dec(n) {   return require('.\/steps')(n\/2)+1; } module.exports = dec;<\/code><\/pre>\n<\/td>\n<td>\n<pre><code class=\"javascript\">expose(dec) function dec(n) {   return root.collatz.steps(n\/2)+1; }<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<p>  \u0412\u0437\u0430\u0438\u043c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 AMD \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"http:\/\/requirejs.org\/docs\/api.html#circular\">\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0443<\/a> \u2014 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 require \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u044f\u0432\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0442\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043d\u043e \u043e\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u0430 \u0432\u044b\u043b\u0435\u0437\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0435\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u0430 \u0432 <a href=\"https:\/\/groups.google.com\/forum\/#!topic\/commonjs\/b9hbk0QgVGQ\">\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438<\/a> \u0422\u043e\u043c\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043d\u0435\u0439 \u0432 YAMD \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u0432 <code>expose<\/code> \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043c\u043e\u0434\u0443\u043b\u044f), \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u044f\u0442\u0441\u044f.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 <code>steps<\/code> \u0438 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 <code>n<\/code> \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0448\u0430\u0433\u043e\u0432 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <code>tableLookup<\/code>.<\/p>\n<pre><code class=\"javascript\">function tableLookup(table, f) {     return function(n) {         if (n in table) return table[n];         return f(n);     } }<\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b steps.js \u0432 YAMD \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"javascript\">\/\/ FILE .\/math\/collatz\/steps.js var table = {}; expose(tableLookup(table, steps), ctor); function ctor() {     table[3] = steps(3); } function steps(n) {     if (n==1) return 0;     if (n%2==0) return root.collatz.dec(n);     if (n%2==1) return root.collatz.inc(n); }<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CommonJS\/AMD \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435:  <\/p>\n<ul>\n<li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u044f\u0432\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<li>\u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e table \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u043e\u0445\u043e \u2014 \u0432 CommonJS \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0438\u0431\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c API, \u043b\u0438\u0431\u043e \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c single responsibility principle \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 steps \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043b\u0435\u043d\u0438\u0432\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"javascript\">\/\/ FILE .\/math\/collatz\/steps.js var table = {}; var inited = false; function ctor() {     table[3] = steps(3); } function steps(n) {     if (!inited) {         ctor();         inited = true     }     if (n==1) return 0;     if (n%2==0) return require('.\/dec')(n);     if (n%2==1) return require('.\/inc')(n); } module.exports = tableLookup(table, steps)<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0433\u043b\u0430\u0437\u0430 \u043d\u0430 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 SRP \u0432 CommonJS \u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043f\u043b\u043e\u0445\u0438 \u0442\u043e\u0440\u043c\u043e\u0437\u0430\u043c\u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 YAMD, \u0442\u043e\u0440\u043c\u043e\u0437\u0430\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 CommonJS, \u0442\u043e\u0440\u043c\u043e\u0437\u0430\u043c\u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>steps<\/code>. \u041d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u0436\u0435\u043b\u0430\u044f, \u0430 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0442\u0430\u043a\u0430\u044f, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f YAMD \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0435\u0451 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b WebWorker&#8217;\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 ctor \u0438 \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 `steps` \u043e\u043d\u0430 \u0443\u0436\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CommonJS \u0442\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0448\u0430\u043d\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0443\u0441\u043f\u0435\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0442\u043e\u0440\u043c\u0430\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0418 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043a\u0430\u043a \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/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=\"http:\/\/habrahabr.ru\/post\/190700\/\"> http:\/\/habrahabr.ru\/post\/190700\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0441\u0442\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 JS, \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 (~5K SLoC). \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b <a href=\"http:\/\/requirejs.org\/\">AMD<\/a> \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0448\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0448\u044c \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043b\u043e\u0433\u0438\u043a\u0443\u2026 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. \u041d\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AMD \u0438\u043b\u0438 <a href=\"http:\/\/en.wikipedia.org\/wiki\/CommonJS\">CommonJS<\/a> \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <u>\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0432\u044f\u0437\u043e\u043a<\/u> (boilerplate), \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 <u>\u0447\u0430\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b<\/u>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 JS \u2014 <a href=\"https:\/\/github.com\/rystsov\/yamd\">YAMD<\/a>.<\/p>\n<p>  <i>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u042d\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0430 AMD \u0438\u043b\u0438 CommonJS, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e AMD, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e, \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e YAMD. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, YAMD \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u043e\u0435\u0434\u0438\u043d\u043e.<\/i><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u0434\u0445\u043e\u0434. \u041e\u0442 \u0432\u0430\u0441 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0447\u0442\u043e \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0434\u043b\u044f \u0442\u0435\u0445 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447.<\/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-190700","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190700","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=190700"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190700\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}