{"id":290244,"date":"2018-10-03T13:05:02","date_gmt":"2018-10-03T09:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290244"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290244","title":{"rendered":"\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Node.js, \u0447\u0430\u0441\u0442\u044c 9: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0434\u0435\u0432\u044f\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Node.js, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043c\u043e\u0434\u0443\u043b\u044f\u0445 fs \u0438 path \u2014 \u043e \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u0445, \u043e \u043f\u0443\u0442\u044f\u0445 \u043a \u0444\u0430\u0439\u043b\u0430\u043c, \u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0444\u0430\u0439\u043b\u0430\u0445, \u043e\u0431 \u0438\u0445 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424969\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/he\/di\/2j\/hedi2j_qyfbnwfo_jqnnqd3ub6o.png\"><\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">[\u0421\u043e\u0432\u0435\u0442\u0443\u0435\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c] \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0446\u0438\u043a\u043b\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u044c 1: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/422893\/\">\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 2: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423153\/\">JavaScript, V8, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0451\u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 3: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423701\/\">\u0425\u043e\u0441\u0442\u0438\u043d\u0433, REPL, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e, \u043c\u043e\u0434\u0443\u043b\u0438<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 4: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423703\/\">npm, \u0444\u0430\u0439\u043b\u044b package.json \u0438 package-lock.json<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 5: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423705\/\">npm \u0438 npx<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 6: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424553\/\">\u0446\u0438\u043a\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0442\u0430\u0439\u043c\u0435\u0440\u044b<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 7: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424555\/\">\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a>  <\/div>\n<\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u043c\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 Node.js<\/font><\/h2>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>  \u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>open()<\/code> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>fs<\/code>:<\/p>\n<pre><code>const fs = require('fs') fs.open('\/Users\/flavio\/test.txt', 'r', (err, fd) =&gt; {  \u00a0\/\/fd - \u044d\u0442\u043e \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430 })<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, <code>r<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <code>fs.open()<\/code>. \u042d\u0442\u043e \u2014 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u0412\u043e\u0442 \u0435\u0449\u0451 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u043b\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438:<\/p>\n<ul>\n<li><code>r+<\/code> \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438.<\/li>\n<li><code>w+<\/code> \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u2014 \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f.<\/li>\n<li><code>a<\/code> \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u2014 \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f.<\/li>\n<li><code>a+<\/code> \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u2014 \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f.<\/li>\n<\/ul>\n<p>  \u0424\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>fs.openSync()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e:<\/p>\n<pre><code>const fs = require('fs') try {  \u00a0const fd = fs.openSync('\/Users\/flavio\/test.txt', 'r') } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0441 \u043d\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2><font color=\"#3AC1EF\">\u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u0444\u0430\u0439\u043b\u0430\u0445<\/font><\/h2>\n<p>  \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0441\u0432\u044f\u0437\u0430\u043d \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043d\u0451\u043c, \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Node.js. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 <code>stat()<\/code> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>fs<\/code>.<\/p>\n<p>  \u0412\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0435\u043c\u0443 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u0438, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Node.js \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0444\u0430\u0439\u043b\u0435, \u043e\u043d \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043a\u043e\u043b\u043b\u0431\u044d\u043a, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434\u0443 <code>stat()<\/code>. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code>const fs = require('fs') fs.stat('\/Users\/flavio\/test.txt', (err, stats) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0\/\/\u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0444\u0430\u0439\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 `stats` })<\/code><\/pre>\n<p>  \u0412 Node.js \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043e \u0444\u0430\u0439\u043b\u0430\u0445. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>const fs = require('fs') try {  \u00a0const stats = fs.statSync ('\/Users\/flavio\/test.txt') } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <code>stats<\/code>. \u0427\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<ul>\n<li>\u041c\u0435\u0442\u043e\u0434\u044b <code>.isFile()<\/code> \u0438 <code>.isDirectory()<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0437\u043d\u0430\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0438\u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>.isSymbolicLink()<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0444\u0430\u0439\u043b \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439.<\/li>\n<li>\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>.size<\/code>.<\/li>\n<\/ul>\n<p>  \u0422\u0443\u0442 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u044d\u0442\u0438 \u2014 \u0441\u0430\u043c\u044b\u0435 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u043c\u044b\u0435. \u0412\u043e\u0442 \u043a\u0430\u043a \u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<pre><code>const fs = require('fs') fs.stat('\/Users\/flavio\/test.txt', (err, stats) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0stats.isFile() \/\/true  \u00a0stats.isDirectory() \/\/false  \u00a0stats.isSymbolicLink() \/\/false  \u00a0stats.size \/\/1024000 \/\/= 1MB })<\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u041f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 Node.js \u0438 \u043c\u043e\u0434\u0443\u043b\u044c path<\/font><\/h2>\n<p>  \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0433\u0434\u0435 \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d.<\/p>\n<p>  \u0412 Linux \u0438 macOS \u043f\u0443\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code>\/users\/flavio\/file.txt<\/code><\/pre>\n<p>  \u0412 Windows \u043f\u0443\u0442\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435:<\/p>\n<pre><code>C:\\users\\flavio\\file.txt<\/code><\/pre>\n<p>  \u041d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0443\u0442\u0435\u0439 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Node.js-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u0412 Node.js \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <code>path<\/code>, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c. \u041f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c:<\/p>\n<pre><code>const path = require('path')<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0443<\/font><\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044f <code>path<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435, \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0438\u0434\u0435, \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0438. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>const notes = '\/users\/flavio\/notes.txt' path.dirname(notes) \/\/ \/users\/flavio path.basename(notes) \/\/ notes.txt path.extname(notes) \/\/ .txt<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 <code>notes<\/code>, \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443. \u0414\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043f\u0443\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0434\u0443\u043b\u044f <code>path<\/code>:<\/p>\n<ul>\n<li><code>dirname()<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>basename()<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>extname()<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430.<\/li>\n<\/ul>\n<p>  \u0423\u0437\u043d\u0430\u0442\u044c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 <code>.basename()<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>path.basename(notes, path.extname(notes)) \/\/notes<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c<\/font><\/h3>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u0443\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 <code>path.join()<\/code>:<\/p>\n<pre><code>const name = 'flavio' path.join('\/', 'users', name, 'notes.txt') \/\/'\/users\/flavio\/notes.txt'<\/code><\/pre>\n<p>  \u041d\u0430\u0439\u0442\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <code>path.resolve()<\/code>:<\/p>\n<pre><code>path.resolve('flavio.txt')  \/\/'\/Users\/flavio\/flavio.txt' \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043f\u0430\u043f\u043a\u0438<\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Node.js \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 <code>\/flavio.txt<\/code> \u043a \u043f\u0443\u0442\u0438, \u0432\u0435\u0434\u0443\u0449\u0435\u043c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435, \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438:<\/p>\n<pre><code>path.resolve('tmp', 'flavio.txt') \/\/ '\/Users\/flavio\/tmp\/flavio.txt' \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043f\u0430\u043f\u043a\u0438<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0443\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u0441\u043e\u0439 \u0447\u0435\u0440\u0442\u044b \u2014 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<pre><code>path.resolve('\/etc', 'flavio.txt') \/\/ '\/etc\/flavio.txt'<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 <code>path.normalize()<\/code>. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0443\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0432\u0440\u043e\u0434\u0435 \u0442\u043e\u0447\u043a\u0438 (<code>.<\/code>), \u0434\u0432\u0443\u0445 \u0442\u043e\u0447\u0435\u043a (<code>..<\/code>), \u0438\u043b\u0438 \u0434\u0432\u0443\u0445 \u043a\u043e\u0441\u044b\u0445 \u0447\u0435\u0440\u0442:<\/p>\n<pre><code>path.normalize('\/users\/flavio\/..\/\/test.txt')  \/\/ \/users\/test.txt<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434\u044b <code>resolve()<\/code> \u0438 <code>normalize()<\/code> \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u041e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u043f\u0443\u0442\u044c, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<h2><font color=\"#3AC1EF\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Node.js<\/font><\/h2>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Node.js \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>fs.readFile()<\/code> \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0435\u043c\u0443 \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0443 \u0438 \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430 (\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438):<\/p>\n<pre><code>fs.readFile('\/Users\/flavio\/test.txt', (err, data) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0console.log(data) })<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 <code>fs.readFileSync()<\/code>:<\/p>\n<pre><code>const fs = require('fs') try {  \u00a0const data = fs.readFileSync('\/Users\/flavio\/test.txt')  \u00a0console.log(data) } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 <code>utf8<\/code>, \u043d\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u043c\u0435\u0442\u043e\u0434\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434\u044b <code>fs.readFile()<\/code> \u0438 <code>fs.readFileSync()<\/code> \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0441\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h2><font color=\"#3AC1EF\">\u0417\u0430\u043f\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Node.js<\/font><\/h2>\n<p>  \u0412 Node.js \u043b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <code>fs.writeFile()<\/code>:<\/p>\n<pre><code>const fs = require('fs') const content = 'Some content!' fs.writeFile('\/Users\/flavio\/test.txt', content, (err) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0\/\/\u0444\u0430\u0439\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e })<\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 <code>fs.writeFileSync()<\/code>:<\/p>\n<pre><code>const fs = require('fs') const content = 'Some content!' try {  \u00a0const data = fs.writeFileSync('\/Users\/flavio\/test.txt', content)  \u00a0\/\/\u0444\u0430\u0439\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  \u042d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0444\u043b\u0430\u0433\u043e\u043c:<\/p>\n<pre><code>fs.writeFile('\/Users\/flavio\/test.txt', content, { flag: 'a+' }, (err) =&gt; {})<\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u043b\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u043c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0444\u043b\u0430\u0433\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c <a href=\"https:\/\/nodejs.org\/api\/fs.html#fs_file_system_flags\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2><font color=\"#3AC1EF\">\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0444\u0430\u0439\u043b\u0443<\/font><\/h2>\n<p>  \u041c\u0435\u0442\u043e\u0434 <code>fs.appendFile()<\/code> (\u0438 \u0435\u0433\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u2014 <code>fs.appendFileSync()<\/code>) \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u043a\u043e\u043d\u0446\u0443 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>const content = 'Some content!' fs.appendFile('file.log', content, (err) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e! })<\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u041e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432<\/font><\/h2>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b, \u043f\u0438\u0448\u0443\u0442 \u0432 \u043d\u0435\u0433\u043e \u0432\u0435\u0441\u044c \u043e\u0431\u044a\u0451\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u0445 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u0430 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u0435\u043b \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u2014 \u043b\u0443\u0447\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h2><font color=\"#3AC1EF\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438 \u0432 Node.js<\/font><\/h2>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c <code>fs<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438.<\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043a\u0438<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 Node.js \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>fs.access()<\/code>.<\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u043f\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>fs.mkdir()<\/code> \u0438 <code>fs.mkdirSync()<\/code>:<\/p>\n<pre><code>const fs = require('fs') const folderName = '\/Users\/flavio\/test' try {  \u00a0if (!fs.existsSync(dir)){  \u00a0\u00a0\u00a0fs.mkdirSync(dir)  \u00a0} } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u0427\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043f\u043a\u0438<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>fs.readdir()<\/code> \u0438 <code>fs.readdirSync()<\/code>. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043f\u043a\u0438 \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u2014 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0434\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u043d\u0435\u0439 \u0438\u043c\u0435\u044e\u0442\u0441\u044f, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0445 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439:<\/p>\n<pre><code>const fs = require('fs') const path = require('path') const folderPath = '\/Users\/flavio' fs.readdirSync(folderPath)<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443:<\/p>\n<pre><code>fs.readdirSync(folderPath).map(fileName =&gt; {  \u00a0return path.join(folderPath, fileName) }<\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/p>\n<pre><code>const isFile = fileName =&gt; {  \u00a0return fs.lstatSync(fileName).isFile() } fs.readdirSync(folderPath).map(fileName =&gt; {  \u00a0return path.join(folderPath, fileName)).filter(isFile) }<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>fs.rename()<\/code> \u0438 <code>fs.renameSync()<\/code>. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 \u044d\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u043e\u0432\u044b\u0439:<\/p>\n<pre><code>const fs = require('fs') fs.rename('\/Users\/flavio', '\/Users\/roger', (err) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0\u00a0\u00a0return  \u00a0}  \u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e })<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>fs.renameSync()<\/code>:<\/p>\n<pre><code>const fs = require('fs') try {  \u00a0fs.renameSync('\/Users\/flavio', '\/Users\/roger') } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>fs.rmdir()<\/code> \u0438\u043b\u0438 <code>fs.rmdirSync()<\/code>. \u041d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0447\u0442\u043e-\u0442\u043e \u0435\u0441\u0442\u044c, \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u0447\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u043c <a href=\"https:\/\/www.npmjs.com\/package\/fs-extra\">fs-extra<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u0443 \u043c\u043e\u0434\u0443\u043b\u044f <code>fs<\/code>, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0443\u044e \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 <code>remove()<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>fs-extra<\/code> \u0443\u043c\u0435\u0435\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u0430\u043f\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u0435\u0441\u0442\u044c.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>npm install fs-extra<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>const fs = require('fs-extra') const folder = '\/Users\/flavio' fs.remove(folder, err =&gt; {  \u00a0console.error(err) })<\/code><\/pre>\n<p>  \u0415\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u043c\u0438\u0441\u043e\u0432:<\/p>\n<pre><code>fs.remove(folder).then(() =&gt; {  \u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e }).catch(err =&gt; {  \u00a0console.error(err) })<\/code><\/pre>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 async\/await:<\/p>\n<pre><code>async function removeFolder(folder) {  \u00a0try {  \u00a0\u00a0\u00a0await fs.remove(folder)  \u00a0\u00a0\u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e  \u00a0} catch (err) {  \u00a0\u00a0\u00a0console.error(err)  \u00a0} } const folder = '\/Users\/flavio' removeFolder(folder)<\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u041c\u043e\u0434\u0443\u043b\u044c fs<\/font><\/h2>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u044b \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f <code>fs<\/code>, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e. \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c:<\/p>\n<pre><code>const fs = require('fs')<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u043c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b:<\/p>\n<ul>\n<li><code>fs.access()<\/code>: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/li>\n<li><code>fs.appendFile()<\/code>: \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u0444\u0430\u0439\u043b\u0443. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d.<\/li>\n<li><code>fs.chmod()<\/code>: \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: <code>fs.lchmod()<\/code>, <code>fs.fchmod()<\/code>.<\/li>\n<li><code>fs.chown()<\/code>: \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: <code>fs.fchown()<\/code>, <code>fs.lchown()<\/code>.<\/li>\n<li><code>fs.close()<\/code>: \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>fs.copyFile()<\/code>: \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b.<\/li>\n<li><code>fs.createReadStream()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u0442\u043e\u043a \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>fs.createWriteStream()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u0442\u043e\u043a \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>fs.link()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u0443\u044e \u0436\u0451\u0441\u0442\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0444\u0430\u0439\u043b.<\/li>\n<li><code>fs.mkdir()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<\/li>\n<li><code>fs.mkdtemp()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<\/li>\n<li><code>fs.open()<\/code>: \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b.<\/li>\n<li><code>fs.readdir()<\/code>: \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/li>\n<li><code>fs.readFile()<\/code>: \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434: <code>fs.read()<\/code>.<\/li>\n<li><code>fs.readlink()<\/code>: \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/li>\n<li><code>fs.realpath()<\/code>: \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>. <\/code>\u0438<code> ..<\/code>, \u0432 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/li>\n<li><code>fs.rename()<\/code>: \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0443.<\/li>\n<li><code>fs.rmdir()<\/code>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043f\u0430\u043f\u043a\u0443.<\/li>\n<li><code>fs.stat()<\/code>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0444\u0430\u0439\u043b\u0435. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: <code>fs.fstat()<\/code>, <code>fs.lstat()<\/code>.<\/li>\n<li><code>fs.symlink()<\/code>: \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u0443\u044e \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0444\u0430\u0439\u043b.<\/li>\n<li><code>fs.truncate()<\/code>: \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434: <code>fs.ftruncate()<\/code>.<\/li>\n<li><code>fs.unlink()<\/code>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443.<\/li>\n<li><code>fs.unwatchFile()<\/code>: \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>fs.utimes()<\/code>: \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u0442\u043c\u0435\u0442\u043a\u0443 \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434: <code>fs.futimes()<\/code>.<\/li>\n<li><code>fs.watchFile()<\/code>: \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434: <code>fs.watch()<\/code>.<\/li>\n<li><code>fs.writeFile()<\/code>: \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b. \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434: <code>fs.write()<\/code>.<\/li>\n<\/ul>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0434\u0443\u043b\u044f <code>fs<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438, \u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0438\u0445 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430 <code>Sync<\/code> \u043a \u0438\u043c\u0435\u043d\u0430\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li><code>fs.rename()<\/code><\/li>\n<li><code>fs.renameSync()<\/code><\/li>\n<li><code>fs.write()<\/code><\/li>\n<li><code>fs.writeSync()<\/code><\/li>\n<\/ul>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<p>  \u0412 Node.js 10 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0442\u0438\u0445 <a href=\"https:\/\/nodejs.org\/api\/fs.html#fs_fs_promises_api\">API<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u043e\u043c\u0438\u0441\u0430\u0445.<\/p>\n<p>  \u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>fs.rename()<\/code>. \u0412\u043e\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0438:<\/p>\n<pre><code>const fs = require('fs') fs.rename('before.json', 'after.json', (err) =&gt; {  \u00a0if (err) {  \u00a0\u00a0\u00a0return console.error(err)  \u00a0}  \u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e })<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0435\u0433\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>try\/catch<\/code>:<\/p>\n<pre><code>const fs = require('fs') try {  \u00a0fs.renameSync('before.json', 'after.json')  \u00a0\/\/\u0433\u043e\u0442\u043e\u0432\u043e } catch (err) {  \u00a0console.error(err) }<\/code><\/pre>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2><font color=\"#3AC1EF\">\u041c\u043e\u0434\u0443\u043b\u044c path<\/font><\/h2>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c path, \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0442\u043e\u0436\u0435 \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e Node.js. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c, \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c:<\/p>\n<pre><code>const path = require('path')<\/code><\/pre>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>path.sep<\/code> \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0443\u0442\u0438 (<code>\\<\/code> \u0432 Windows \u0438 <code>\/<\/code> \u0432 Linux \u0438 macOS), \u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>path.delimiter<\/code> \u0434\u0430\u0451\u0442 \u0441\u0438\u043c\u0432\u043e\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439 (<code>;<\/code> \u0432 Windows \u0438 <code>:<\/code> \u0432 Linux \u0438 macOS).<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0434\u0443\u043b\u044f <code>path<\/code>.<\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.basename()<\/font><\/h3>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u0443\u0442\u0438. \u041f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code>require('path').basename('\/test\/something') \/\/something require('path').basename('\/test\/something.txt') \/\/something.txt require('path').basename('\/test\/something.txt', '.txt') \/\/something<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.dirname()<\/font><\/h3>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/p>\n<pre><code>require('path').dirname('\/test\/something') \/\/ \/test require('path').dirname('\/test\/something\/file.txt') \/\/ \/test\/something &lt;h3&gt;&lt;font color=\"#3AC1EF\"&gt;\u258dpath.extname()&lt;\/font&gt;&lt;\/h3&gt; &lt;\/code&gt;\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430:  &lt;source&gt;require('path').dirname('\/test\/something') \/\/ '' require('path').dirname('\/test\/something\/file.txt') \/\/ '.txt'<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.isAbsolute()<\/font><\/h3>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0435\u0441\u043b\u0438 \u043f\u0443\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c:<\/p>\n<pre><code>require('path').isAbsolute('\/test\/something') \/\/ true require('path').isAbsolute('.\/test\/something') \/\/ false<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.join()<\/font><\/h3>\n<p>  \u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u0443\u0442\u0438:<\/p>\n<pre><code>const name = 'flavio' require('path').join('\/', 'users', name, 'notes.txt') \/\/'\/users\/flavio\/notes.txt'<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.normalize()<\/font><\/h3>\n<p>  \u041f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u0432\u0440\u043e\u0434\u0435 <code>.<\/code>, <code>..<\/code> \u0438 <code>\/\/<\/code>:<\/p>\n<pre><code>require('path').normalize('\/users\/flavio\/..\/\/test.txt') \/\/\/users\/test.txt<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.parse()<\/font><\/h3>\n<p>  \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0443\u0442\u0438:<\/p>\n<ul>\n<li><code>root<\/code>: \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f.<\/li>\n<li><code>dir<\/code>: \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/li>\n<li><code>base<\/code>: \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435.<\/li>\n<li><code>name<\/code>: \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><code>ext<\/code>: \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430.<\/li>\n<\/ul>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code>require('path').parse('\/users\/test.txt')<\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442:<\/p>\n<pre><code>{  \u00a0root: '\/',  \u00a0dir: '\/users',  \u00a0base: 'test.txt',  \u00a0ext: '.txt',  \u00a0name: 'test' }<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.relative()<\/font><\/h3>\n<p>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, 2 \u043f\u0443\u0442\u0438. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/p>\n<pre><code>require('path').relative('\/Users\/flavio', '\/Users\/flavio\/test.txt') \/\/'test.txt' require('path').relative('\/Users\/flavio', '\/Users\/flavio\/something\/test.txt') \/\/'something\/test.txt'<\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258dpath.resolve()<\/font><\/h3>\n<p>  \u041d\u0430\u0445\u043e\u0434\u0438\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0435\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438:<\/p>\n<pre><code>path.resolve('flavio.txt')  \/\/'\/Users\/flavio\/flavio.txt' \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043f\u0430\u043f\u043a\u0438.<\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0418\u0442\u043e\u0433\u0438<\/font><\/h2>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 Node.js <code>fs<\/code> \u0438 <code>path<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f, \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0438 <code>os<\/code>, <code>events<\/code>, <code>http<\/code>, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0438 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Node.js.<\/p>\n<p>  <b>\u0423\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438!<\/b> \u041a\u0430\u043a\u0438\u043c\u0438 npm-\u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0432 Node.js?<\/p>\n<p>  <a href=\"https:\/\/ruvds.com\/ru-rub\/#order\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1ba\/550\/d25\/1ba550d25e8846ce8805de564da6aa63.png\"><\/a><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \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\/post\/424969\/\"> https:\/\/habr.com\/post\/424969\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0434\u0435\u0432\u044f\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Node.js, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043c\u043e\u0434\u0443\u043b\u044f\u0445 fs \u0438 path \u2014 \u043e \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u0445, \u043e \u043f\u0443\u0442\u044f\u0445 \u043a \u0444\u0430\u0439\u043b\u0430\u043c, \u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0444\u0430\u0439\u043b\u0430\u0445, \u043e\u0431 \u0438\u0445 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424969\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/he\/di\/2j\/hedi2j_qyfbnwfo_jqnnqd3ub6o.png\"><\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">[\u0421\u043e\u0432\u0435\u0442\u0443\u0435\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c] \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0446\u0438\u043a\u043b\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u044c 1: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/422893\/\">\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 2: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423153\/\">JavaScript, V8, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0451\u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 3: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423701\/\">\u0425\u043e\u0441\u0442\u0438\u043d\u0433, REPL, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e, \u043c\u043e\u0434\u0443\u043b\u0438<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 4: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423703\/\">npm, \u0444\u0430\u0439\u043b\u044b package.json \u0438 package-lock.json<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 5: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/423705\/\">npm \u0438 npx<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 6: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424553\/\">\u0446\u0438\u043a\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0442\u0430\u0439\u043c\u0435\u0440\u044b<\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 7: <a href=\"https:\/\/habr.com\/company\/ruvds\/blog\/424555\/\">\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a>  <\/div>\n<\/div>\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-290244","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290244","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=290244"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290244\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}