{"id":212817,"date":"2014-02-17T00:58:03","date_gmt":"2014-02-16T20:58:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=212817"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=212817","title":{"rendered":"<span class=\"post_title\">Definer.js \u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u043a\u0430 JavaScript \u043d\u0435 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u0441\u0432\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u2014 <a href=\"https:\/\/github.com\/tenorok\/definer\">definer<\/a>.<\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442.<\/p>\n<p>  \u0414\u043b\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0434\u0435\u0438, \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, <code>index.html<\/code>:  <\/p>\n<pre><code class=\"html\">&lt;html&gt; &lt;head&gt;     &lt;meta charset=&quot;utf-8&quot;\/&gt;     &lt;title&gt;\u041a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430&lt;\/title&gt;     &lt;script src=&quot;jquery.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;https:\/\/rawgithub.com\/tenorok\/definer\/master\/definer.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;modules\/cart.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;modules\/list.js&quot;&gt;&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt;     &lt;ul class=&quot;list&quot;&gt;         &lt;li class=&quot;item&quot;&gt;             &lt;span class=&quot;name&quot;&gt;\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440&lt;\/span&gt;, &lt;span class=&quot;price&quot;&gt;250&lt;\/span&gt;         &lt;\/li&gt;         &lt;li class=&quot;item&quot;&gt;             &lt;span class=&quot;name&quot;&gt;\u0422\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440&lt;\/span&gt;, &lt;span class=&quot;price&quot;&gt;100&lt;\/span&gt;         &lt;\/li&gt;         &lt;li class=&quot;item&quot;&gt;             &lt;span class=&quot;name&quot;&gt;\u0425\u043e\u043b\u043e\u0434\u0438\u043b\u044c\u043d\u0438\u043a&lt;\/span&gt;, &lt;span class=&quot;price&quot;&gt;300&lt;\/span&gt;         &lt;\/li&gt;     &lt;\/ul&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DOM \u0438 definer \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c <code>Cart<\/code>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0432\u0430\u0440 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"javascript\">definer('Cart', function() {      function Cart() {         this.list = [];     }      Cart.prototype = {         add: function(target) {             var item = $(target);             this.list.push({                 name: item.find('.name').text(),                 price: +item.find('.price').text()             });         },         sum: function() {             return this.list.reduce(function(sum, item) {                 return sum + item.price;             }, 0);         }     };      return Cart;  }); <\/code><\/pre>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c <code>list<\/code>, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0439 \u043e\u0442 <code>Cart<\/code> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f \u0441 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c:  <\/p>\n<pre><code class=\"javascript\">definer('list', function(Cart) {      var iCart = new Cart();      $(function() {         $('.item').on('click', function(e) {             iCart.add(e.currentTarget);             console.log(iCart.sum());         });     });  }); <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u0442\u043e\u0432\u0430\u0440\u0443 \u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u041d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0443 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c, \u044d\u0442\u043e jQuery.<\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0444\u0430\u0439\u043b <code>modules\/clean.js<\/code> \u043f\u0435\u0440\u0435\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438:  <\/p>\n<pre><code class=\"javascript\">definer.clean('$'); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>$<\/code> \u043d\u0435\u0442 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435:  <\/p>\n<pre><code class=\"javascript\">console.log($); \/\/ undefined <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:  <\/p>\n<pre><code class=\"javascript\">definer('Cart', function($) { ... }); definer('list', function($, Cart) { ... }); <\/code><\/pre>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439:  <\/p>\n<pre><code class=\"bash\">npm install definer <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>modules<\/code> \u0432 \u0444\u0430\u0439\u043b <code>index.js<\/code>:  <\/p>\n<pre><code class=\"bash\">.\/node_modules\/.bin\/definer -d modules\/ index.js <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 <code>index.html<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e jQuery \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;jquery.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;index.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e grunt-definer<\/h4>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/tenorok\/grunt-definer\">grunt-\u043f\u043b\u0430\u0433\u0438\u043d<\/a>. \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">npm install grunt grunt-cli grunt-contrib-watch grunt-definer <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0444\u0430\u0439\u043b <code>Gruntfile.js<\/code>:  <\/p>\n<pre><code class=\"javascript\">module.exports = function(grunt) {      grunt.initConfig({         watch: {             scripts: {                 files: ['modules\/*.js'],                 tasks: ['definer:all']             },         },         definer: {             all: {                 target: 'index.js',                 directory: 'modules\/'             }         }     });      grunt.loadNpmTasks('grunt-contrib-watch');     grunt.loadNpmTasks('grunt-definer');  }; <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433:  <\/p>\n<pre><code class=\"bash\">.\/node_modules\/.bin\/grunt watch <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u0444\u043e\u043d\u0435, \u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432<\/h4>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u2014 jQuery \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c jQuery \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e <code>clean<\/code> \u0432 grunt-\u0446\u0435\u043b\u044c:  <\/p>\n<pre><code class=\"javascript\">definer: {     all: {         target: 'index.js',         directory: 'modules\/',         clean: {             $: 'jquery.js'         }     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 <code>index.html<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;index.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<h4>JSDoc<\/h4>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JSDoc, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0446\u0438\u044e <code>jsdoc<\/code> \u0432 grunt-\u0446\u0435\u043b\u044c:  <\/p>\n<pre><code class=\"javascript\">jsdoc: {     &quot;file&quot;: &quot;\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430&quot;,     &quot;copyright&quot;: &quot;2014 Artem Kurbatov, tenorok.ru&quot;,     &quot;license&quot;: &quot;MIT license&quot;,     &quot;version&quot;: &quot;package.json&quot;,     &quot;date&quot;: true } <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0434\u043e JSON-\u0444\u0430\u0439\u043b\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<\/p>\n<p>  \u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0444\u0430\u0439\u043b <code>package.json<\/code>:  <\/p>\n<pre><code class=\"javascript\">{     &quot;version&quot;: &quot;0.1.0&quot; } <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0432 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 JSDoc:  <\/p>\n<pre><code class=\"javascript\">\/*!  * @file \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430  * @copyright 2014 Artem Kurbatov, tenorok.ru  * @license MIT license  * @version 0.1.0  * @date 17 February 2014  *\/ <\/code><\/pre>\n<h4>\u0418\u0442\u043e\u0433\u043e<\/h4>\n<p>  Definer \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442:  <\/p>\n<ul>\n<li>\u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0432\u0441\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c<\/li>\n<li>\u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/li>\n<li>\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e grunt-\u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/li>\n<\/ul>\n<p>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e <a href=\"https:\/\/github.com\/tenorok\/definer\">definer<\/a> \u0438 <a href=\"https:\/\/github.com\/tenorok\/grunt-definer\">grunt-definer<\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435.    \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\/212817\/\"> http:\/\/habrahabr.ru\/post\/212817\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u043a\u0430 JavaScript \u043d\u0435 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u0441\u0432\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u2014 <a href=\"https:\/\/github.com\/tenorok\/definer\">definer<\/a>.<\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442.<\/p>\n<p>  \u0414\u043b\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0434\u0435\u0438, \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443.<\/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-212817","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/212817","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=212817"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/212817\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=212817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=212817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=212817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}