{"id":230831,"date":"2014-07-23T15:46:02","date_gmt":"2014-07-23T11:46:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=230831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=230831","title":{"rendered":"<span class=\"post_title\">NPM 2.0.0 &#038; \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 run-script<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t22 \u0438\u044e\u043b\u044f \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u043d\u043e \u0437\u043d\u0430\u043c\u0435\u043d\u0442\u0430\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435: \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442 <a href=\"https:\/\/github.com\/npm\/npm\/pull\/5518\">\u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442<\/a>, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0432\u0430\u0448\u0438 npm script&#8217;\u044b. \u0423\u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f <a href=\"https:\/\/github.com\/npm\/npm\/releases\/tag\/v2.0.0-alpha-5\">\u0430\u043b\u044c\u0444\u0430-\u0440\u0435\u043b\u0438\u0437<\/a> npm \u0432\u0435\u0441\u0440\u0438\u0438 2.0.0, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e?<br \/>  \u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0434 node-\u043f\u0430\u043a\u0435\u0442\u043e\u0432 (\u0431\u0438\u043b\u0434-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0442\u0435\u0441\u0442-\u0440\u0430\u043d\u043d\u0435\u0440\u044b) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432: \u043e\u0434\u0438\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u043b \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441 -cli (karma-cli, grunt-cli), \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 node_modules. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0435\u0441\u0442-\u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432, \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u043e\u043c\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u0432\u043e \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u043d\u0438\u0445. \u042d\u0442\u043e, \u0432 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f, \u0441\u0442\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f grunt (\u0432\u0435\u0440\u0441\u0438\u044f 0.4.0 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0430 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043e\u0432).<br \/>  \u0422\u0430\u043a\u0436\u0435, \u0435\u0441\u0442\u044c \u0444\u0430\u043a\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 npm script&#8217;\u0430, \u0432 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f node_modules\/.bin, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0438 \u043b\u0435\u0436\u0430\u0442 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u043d\u043d\u0435\u0440\u044b\/\u0431\u0438\u043b\u0434\u0435\u0440\u044b, \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c cli \u043f\u0430\u043a\u0435\u0442\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u0441\u0432\u043e\u0451\u043c package.json \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"javascript\">scripts: {  grunt: &quot;grunt build&quot; } <\/code><\/pre>\n<p>  \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 grunt \u043f\u0440\u043e\u0441\u0442\u044b\u043c <code>npm run grunt<\/code>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c \u0431\u044b\u043b \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0432\u0430\u0448 npm script \u2013 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0441\u0432\u043e\u0451\u043c package.json  <\/p>\n<pre><code class=\"javascript\">scripts: {  grunt: &quot;grunt&quot; } <\/code><\/pre>\n<p>  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0438\u0434\u0430 <code>npm run grunt - build<\/code> \u0438\u043b\u0438 <code>npm run grunt - build --verbose<\/code>. \u0412 <a href=\"https:\/\/github.com\/npm\/npm\/pull\/5518#issuecomment-48440496\">\u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/a> \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 \u0432\u0438\u0434\u0430 <code>alias gr='npm run grunt --'<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u0438\u043b\u0434 \u043f\u0440\u043e\u0441\u0442\u044b\u043c <code>gr build<\/code>.      \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\/230831\/\"> http:\/\/habrahabr.ru\/post\/230831\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t22 \u0438\u044e\u043b\u044f \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u043d\u043e \u0437\u043d\u0430\u043c\u0435\u043d\u0442\u0430\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435: \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442 <a href=\"https:\/\/github.com\/npm\/npm\/pull\/5518\">\u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442<\/a>, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0432\u0430\u0448\u0438 npm script&#8217;\u044b. \u0423\u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f <a href=\"https:\/\/github.com\/npm\/npm\/releases\/tag\/v2.0.0-alpha-5\">\u0430\u043b\u044c\u0444\u0430-\u0440\u0435\u043b\u0438\u0437<\/a> npm \u0432\u0435\u0441\u0440\u0438\u0438 2.0.0, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.  <\/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-230831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/230831","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=230831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/230831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}