Mercurial > hg > nginx-site
annotate xml/ru/docs/njs/reference.xml @ 2595:ae1d55e33319
Updated Russian version of "Contributing Changes".
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 24 Sep 2020 10:35:07 +0100 |
parents | 7035221dbe37 |
children | 90b32c2c0155 |
rev | line source |
---|---|
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
2246
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
9 <article name="Справочник" |
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
10 link="/ru/docs/njs/reference.html" |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
11 lang="ru" |
2585
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
12 rev="53"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 <para> |
2244
467aef18bf12
Renamed the "About njs" page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2189
diff
changeset
|
17 <link doc="index.xml">njs</link> предоставляет объекты, методы и свойства |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
18 для расширения функциональности nginx. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
19 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
21 <para> |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
22 Справочник содержит описания методов, свойств и модулей, |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
23 доступных только в njs и не соответствующих стандарту ECMAScript. |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
24 Описания методов и свойств njs, |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
25 соответствующих стандарту, доступны в |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
26 <link url="http://www.ecma-international.org/ecma-262/">спецификации |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
27 ECMAScript</link>. |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
28 Список всех методов и свойств njs доступен в разделе |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
29 <link doc="compatibility.xml">Совместимость</link>. |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
30 </para> |
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
31 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
32 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
33 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
34 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
35 <section id="http_stream" name="Объекты nginx"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
36 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
37 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
38 <section id="http" name="HTTP-запрос"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
39 |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
40 <para> |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
41 Объект <literal>HTTP</literal> доступен только в |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
42 модуле <link doc="../http/ngx_http_js_module.xml">ngx_http_js_module</link>. |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
43 Все строки в объекте <literal>HTTP</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
44 <link id="string">байтовыми строками</link>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
45 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
46 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
47 |
2353 | 48 <tag-name id="r_args"><literal>r.args{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
49 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
50 объект аргументов запроса, только чтение |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
51 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
52 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
53 <tag-name id="r_error"><literal>r.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
54 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
55 записывает <literal>строку</literal> в лог-файл ошибок |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
56 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
57 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
58 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
59 <tag-name id="r_finish"><literal>r.finish()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
60 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
61 завершает отправку ответа клиенту |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
62 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
63 |
2353 | 64 <tag-name id="r_headers_in"><literal>r.headersIn{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
65 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
66 объект входящих заголовков, только чтение. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
67 <para> |
2543
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
68 Доступ к заголовку запроса <literal>Foo</literal> |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
69 можно получить при помощи синтаксиса: |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
70 <literal>headersIn.foo</literal> или <literal>headersIn['Foo']</literal>. |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
71 </para> |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
72 |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
73 <para> |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
74 Заголовки запроса |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
75 <header>Authorization</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
76 <header>Content-Length</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
77 <header>Content-Range</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
78 <header>Content-Type</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
79 <header>ETag</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
80 <header>Expect</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
81 <header>From</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
82 <header>Host</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
83 <header>If-Match</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
84 <header>If-Modified-Since</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
85 <header>If-None-Match</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
86 <header>If-Range</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
87 <header>If-Unmodified-Since</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
88 <header>Max-Forwards</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
89 <header>Proxy-Authorization</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
90 <header>Referer</header>, |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
91 <header>Transfer-Encoding</header> и |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
92 <header>User-Agent</header> |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
93 могут иметь только одно значение поля |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
94 (<link doc="changes.xml" id="njs0.4.1">0.4.1</link>). |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
95 Дубликаты значений поля в заголовке запроса <header>Cookie</header> |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
96 разделяются точкой с запятой (<literal>;</literal>). |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
97 Дубликаты значений поля во всех остальных заголовках запроса |
f39c4724c0f8
Described multi-value headers in r.headersIn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2537
diff
changeset
|
98 разделяются запятой. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
99 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
100 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
101 |
2353 | 102 <tag-name id="r_headers_out"><literal>r.headersOut{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
103 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
104 объект исходящих заголовков, доступно для записи. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
105 <para> |
2532
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
106 Доступ к заголовку ответа <literal>Foo</literal> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
107 можно получить при помощи синтаксиса: |
2544
33347df1da9c
Relocated sentence in r.headers.Out, added dot, corrected quotes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2543
diff
changeset
|
108 <literal>headersOut.foo</literal> или <literal>headersOut['Foo']</literal>. |
2532
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
109 </para> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
110 |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
111 <para> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
112 Значения полей многозначных заголовков ответа |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
113 (<link doc="changes.xml" id="njs0.4.0">0.4.0</link>) |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
114 можно задать при помощи синтаксиса: |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
115 <example> |
2544
33347df1da9c
Relocated sentence in r.headers.Out, added dot, corrected quotes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2543
diff
changeset
|
116 r.headersOut['Foo'] = ['a', 'b'] |
2532
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
117 </example> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
118 результат: |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
119 <example> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
120 Foo: a |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
121 Foo: b |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
122 </example> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
123 Все предыдущие значения поля заголовка ответа <header>Foo</header> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
124 будут удалены. |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
125 </para> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
126 |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
127 <para> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
128 В стандартных заголовках ответа, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
129 поля которых могут принимать только одно значение, например |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
130 <header>Content-Type</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
131 учитывается только последний элемент массива. |
2544
33347df1da9c
Relocated sentence in r.headers.Out, added dot, corrected quotes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2543
diff
changeset
|
132 Значения поля в заголовке ответа <header>Set-Cookie</header> |
33347df1da9c
Relocated sentence in r.headers.Out, added dot, corrected quotes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2543
diff
changeset
|
133 всегда возвращаются в виде массива. |
2532
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
134 Дубликаты значений поля в заголовках ответа |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
135 <header>Age</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
136 <header>Content-Encoding</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
137 <header>Content-Length</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
138 <header>Content-Type</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
139 <header>ETag</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
140 <header>Expires</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
141 <header>Last-Modified</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
142 <header>Location</header>, |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
143 <header>Retry-After</header> |
423d813dc8bb
Documented support for multi-value headers in r.headersOut.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2525
diff
changeset
|
144 игнорируются. |
2537
d6bbfd20c82f
Rephrased a sentence in r.headersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2532
diff
changeset
|
145 Дубликаты значений поля в других заголовках ответов |
d6bbfd20c82f
Rephrased a sentence in r.headersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2532
diff
changeset
|
146 разделяются при помощи запятой. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
147 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
148 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
149 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
150 <tag-name id="r_http_version"><literal>r.httpVersion</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
151 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
152 версия HTTP, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
153 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
154 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
155 <tag-name id="r_internal_redirect"><literal>r.internalRedirect(<value>uri</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
156 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
157 осуществляет внутреннее перенаправление на указанный <literal>uri</literal>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
158 Если uri начинается с префикса “<literal>@</literal>”, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
159 то он считается именованным location. |
2525
6ce28e0beec0
Updated description of r.internalRedirect in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2484
diff
changeset
|
160 Перенаправление осуществляется после завершения выполнения обработчика. |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
161 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
162 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
163 <tag-name id="r_log"><literal>r.log(<value>строка</value>)</literal></tag-name> |
2545
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
164 <tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
165 записывает <literal>строку</literal> в лог-файл ошибок |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
166 на уровне лога <literal>info</literal> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
167 </tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
168 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
169 <tag-name id="r_method"><literal>r.method</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
170 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
171 HTTP метод, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
172 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
173 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
174 <tag-name id="r_parent"><literal>r.parent</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
175 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
176 ссылается на родительский объект запроса |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
177 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
178 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
179 <tag-name id="r_remote_address"><literal>r.remoteAddress</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
180 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
181 адрес клиента, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
182 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
183 |
2546
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
184 <tag-name id="r_raw_headers_in"><literal>r.rawHeadersIn{}</literal></tag-name> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
185 <tag-desc> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
186 возвращает массив пар ключей и значений |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
187 таким же, каким он был получен от клиента |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
188 (<link doc="changes.xml" id="njs0.4.1">0.4.1</link>). |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
189 <para> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
190 Например для следующих заголовков запроса: |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
191 <example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
192 Host: localhost |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
193 Foo: bar |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
194 foo: bar2 |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
195 </example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
196 результат <literal>r.rawHeadersIn</literal>: |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
197 <example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
198 [ |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
199 ['Host', 'localhost'], |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
200 ['Foo', 'bar'], |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
201 ['foo', 'bar2'] |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
202 ] |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
203 </example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
204 Значения полей всех заголовков <literal>foo</literal> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
205 можно получить при помощи синтаксиса: |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
206 <example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
207 r.rawHeadersIn.filter(v=>v[0].toLowerCase() == 'foo').map(v=>v[1]) |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
208 </example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
209 результат: |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
210 <example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
211 ['bar', 'bar2'] |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
212 </example> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
213 Имена полей заголовков не приводятся к нижнему регистру, |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
214 дубликаты значений поля не объединяются. |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
215 </para> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
216 </tag-desc> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
217 |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
218 <tag-name id="r_raw_headers_out"><literal>r.rawHeadersOut{}</literal></tag-name> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
219 <tag-desc> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
220 возвращает массив пар ключей и значений заголовков ответа |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
221 (<link doc="changes.xml" id="njs0.4.1">0.4.1</link>). |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
222 Имена полей заголовков не приводятся к нижнему регистру, |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
223 дубликаты значений поля не объединяются. |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
224 </tag-desc> |
6093e9f3615e
Documented rawHeadersIn and rawHeadersOut in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2545
diff
changeset
|
225 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
226 <tag-name id="r_request_body"><literal>r.requestBody</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
227 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
228 возвращает тело запроса клиента, если оно не было |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
229 записано во временный файл. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
230 Чтобы убедиться, что тело запроса клиента находится в памяти, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
231 его размер должен быть ограничен |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
232 <link doc="../http/ngx_http_core_module.xml" id="client_max_body_size"/>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
233 и также необходимо установить достаточный размер буфера при помощи |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
234 <link doc="../http/ngx_http_core_module.xml" id="client_body_buffer_size"/>. |
2356
ea6964391d52
Clarified usage of r.requestBody in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2353
diff
changeset
|
235 Свойство доступно только в директиве |
ea6964391d52
Clarified usage of r.requestBody in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2353
diff
changeset
|
236 <link doc="../http/ngx_http_js_module.xml" id="js_content"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
237 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
238 |
2353 | 239 <tag-name id="r_response_body"><literal>r.responseBody</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
240 <tag-desc> |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
241 хранит тело ответа <link id="r_subrequest">подзапроса</link>, только чтение. |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
242 Размер <literal>r.responseBody</literal> ограничивается директивой |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
243 <link doc="../http/ngx_http_core_module.xml" id="subrequest_output_buffer_size"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
244 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
245 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
246 <tag-name id="r_return"><literal>r.return(код[, строка])</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
247 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
248 отправляет |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
249 клиенту полный ответ с указанным <literal>кодом</literal> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
250 <para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
251 Можно задать или URL перенаправления |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
252 (для кодов 301, 302, 303, 307 и 308), |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
253 или текст тела ответа (для остальных кодов) в качестве второго аргумента |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
254 </para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
255 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
256 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
257 <tag-name id="r_send"><literal>r.send(<value>строка</value>)</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
258 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
259 отправляет часть тела ответа клиенту |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
260 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
261 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
262 <tag-name id="r_send_header"><literal>r.sendHeader()</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
263 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
264 отправляет заголовки HTTP клиенту |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
265 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
266 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
267 <tag-name id="r_status"><literal>r.status</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
268 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
269 статус, доступно для записи |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
270 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
271 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
272 <tag-name id="r_subrequest"><literal>r.subrequest(<value>uri</value>[, |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
273 <value>options</value>[, <value>callback</value>]])</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
274 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
275 создаёт подзапрос с заданными <literal>uri</literal> и |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
276 <literal>options</literal> и устанавливает |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
277 необязательный <literal>callback</literal> завершения. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
278 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
279 <para> |
2340
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
280 <link doc="../dev/development_guide.xml.xml" id="http_subrequests">Подзапрос</link> |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
281 использует входящие заголовки клиентского запроса. |
2340
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
282 Для отправки на проксируемый сервер заголовков, отличных от оригинальных, |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
283 может использоваться директива |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
284 <link doc="../http/ngx_http_proxy_module.xml" id="proxy_set_header"/>. |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
285 Для отправки на проксируемый сервер нового набора заголовков |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
286 может использоваться директива |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
287 <link doc="../http/ngx_http_proxy_module.xml" id="proxy_pass_request_headers"/>. |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
288 </para> |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
289 |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
290 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
291 Если <literal>options</literal> является строкой, то в ней |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
292 содержится срока аргументов подзапроса. |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
293 В противном случае ожидается, что <literal>options</literal> является |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
294 объектом со следующими ключами: |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
295 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
296 <tag-name><literal>args</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
297 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
298 строка с аргументами, по умолчанию используется пустая строка |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
299 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
300 <tag-name><literal>body</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
301 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
302 тело запроса, |
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
303 по умолчанию используется тело запроса родительского объекта запроса |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
304 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
305 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
306 <tag-name><literal>method</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
307 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
308 метод HTTP, по умолчанию используется метод <literal>GET</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
309 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
310 |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
311 <tag-name><literal>detached</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
312 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
313 логический флаг (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>), |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
314 если <literal>true</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
315 то создаваемый подзапрос является независимым подзапросом. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
316 Ответы на независимые подзапросы игнорируются. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
317 В отличие от обычных подзапросов независимый подзапрос |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
318 можно создать внутри обработчика переменной. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
319 Флаг <literal>detached</literal> и аргумент <literal>callback</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
320 являются взаимоисключающими. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
321 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
322 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
323 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
324 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
325 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
326 <para> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
327 <literal>callback</literal> получает |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
328 объект ответа подзапроса с методами и свойствами, |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
329 идентичными родительскому объекту запроса. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
330 </para> |
2484
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
331 |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
332 <para> |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
333 Начиная с версии njs <link doc="changes.xml" id="njs0.3.8">0.3.8</link> |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
334 если не указан <literal>callback</literal>, |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
335 то возвращается объект <literal>Promise</literal>, |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
336 который разрешается в объект ответа подзапроса. |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
337 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
338 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
339 |
2545
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
340 <tag-name id="r_uri"><literal>r.uri</literal></tag-name> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
341 <tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
342 текущий <link doc="../http/ngx_http_core_module.xml" id="var_uri">URI</link> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
343 запроса в |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
344 <link doc="../http/ngx_http_core_module.xml" id="location">нормализованном</link> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
345 виде, только чтение |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
346 </tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
347 |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
348 <tag-name id="r_variables"><literal>r.variables{}</literal></tag-name> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
349 <tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
350 объект переменных nginx, доступно для записи |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
351 (начиная с версии <link doc="changes.xml" id="njs0.2.8">0.2.8</link>) |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
352 </tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
353 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
354 <tag-name id="r_warn"><literal>r.warn(<value>строка</value>)</literal></tag-name> |
2545
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
355 <tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
356 записывает <literal>строку</literal> в лог-файл ошибок |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
357 на уровне лога <literal>warning</literal> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
358 </tag-desc> |
dca5a7053a6c
Sorted alphabetically njs http methods.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2544
diff
changeset
|
359 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
360 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
361 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
362 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
363 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
364 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
365 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
366 <section id="stream" name="Stream-сессия"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
367 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
368 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
369 Объект stream-сессии доступен только в |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
370 модуле |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
371 <link doc="../stream/ngx_stream_js_module.xml">ngx_stream_js_module</link>. |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
372 Все строки в объекте <literal>stream</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
373 <link id="string">байтовыми строками</link>. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
374 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
375 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
376 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
377 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
378 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
379 <tag-name id="s_allow"><literal>s.allow()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
380 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
381 успешно финализирует обработчик фазы |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
382 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
383 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
384 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
385 <tag-name id="s_decline"><literal>s.decline()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
386 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
387 финализирует обработчик фазы и передаёт контроль следующему обработчику |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
388 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
389 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
390 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
391 <tag-name id="s_deny"><literal>s.deny()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
392 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
393 финализирует обработчик фазы с кодом ошибки доступа |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
394 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
395 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
396 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
397 <tag-name id="s_done"><literal>s.done</literal>(<value>[код]</value>)</tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
398 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
399 успешно финализирует текущий обработчик фазы |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
400 или финализирует его с указанным числовым кодом |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
401 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
402 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
403 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
404 <tag-name id="s_error"><literal>s.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
405 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
406 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
407 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
408 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
409 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
410 <tag-name id="s_log"><literal>s.log(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
411 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
412 записывает отправленную <value>строку</value> в лог-файл ошибок |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
413 на уровне лога <literal>info</literal> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
414 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
415 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
416 <tag-name id="s_off"><literal>s.off(<value>имяСобытия</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
417 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
418 отменяет регистрацию callback'а, установленного методом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
419 <link id="s_on">s.on()</link> |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
420 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
421 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
422 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
423 <tag-name id="s_on"><literal>s.on(<value>событие</value>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
424 <value>callback</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
425 <tag-desc> |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
426 регистрирует <literal>callback</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
427 для указанного <literal>события</literal> |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
428 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
429 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
430 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
431 <literal>Событием</literal> может являться одна из следующих строк: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
432 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
433 <tag-name><literal>upload</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
434 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
435 новые данные от клиента |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
436 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
437 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
438 <tag-name><literal>download</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
439 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
440 новые данные к клиенту |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
441 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
442 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
443 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
444 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
445 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
446 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
447 Callback завершения имеет следующий прототип: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
448 <literal>callback(данные, флаги)</literal>, где |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
449 <literal>данные</literal> являются строкой, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
450 <literal>флаги</literal> являются объектом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
451 со следующими свойствами: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
452 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
453 <tag-name id="s_on_callback_last"><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
454 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
455 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
456 true, если данные являются последним буфером. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
457 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
458 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
459 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
460 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
461 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
462 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
463 <tag-name id="s_remote_address"><literal>s.remoteAddress</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
464 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
465 адрес клиента, только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
466 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
467 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
468 <tag-name id="s_send"><literal>s.send(<value>данные</value>[, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
469 <value>параметры</value>])</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
470 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
471 отправляет данные клиенту |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
472 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
473 <literal>Параметры</literal> являются объектом, используемым |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
474 для переопределения флагов буфера nginx, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
475 полученных из буфера входных данных. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
476 Флаги могут быть переопределены при помощи следующих флагов: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
477 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
478 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
479 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
480 <tag-name><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
481 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
482 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
483 true, если буфер является последним буфером |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
484 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
485 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
486 <tag-name><literal>flush</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
487 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
488 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
489 true, если буфер должен иметь флаг <literal>flush</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
490 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
491 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
492 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
493 Метод может быть вызван несколько раз в течение одного вызова callback'a. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
494 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
495 |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
496 <tag-name id="s_variables"><literal>s.variables{}</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
497 <tag-desc> |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
498 объект переменных nginx, доступно для записи |
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
499 (начиная с версии <link doc="changes.xml" id="njs0.2.8">0.2.8</link>) |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
500 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
501 |
2570
44792f1ee284
Added IDs to methods in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2569
diff
changeset
|
502 <tag-name id="s_warn"><literal>s.warn(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
503 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
504 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
505 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
506 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
507 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
508 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
509 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
510 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
511 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
512 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
513 </section> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
514 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
515 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
516 <section id="core" name="Core"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
517 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
518 |
2405
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
519 <section id="core_global" name="Global"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
520 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
521 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
522 <section id="process" name="Process"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
523 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
524 <para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
525 Объект <literal>process</literal> является глобальным объектом, |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
526 предоставляющим информацию о текущем процессе |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
527 (<link doc="changes.xml" id="njs0.3.3">0.3.3</link>). |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
528 </para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
529 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
530 <para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
531 <list type="tag"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
532 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
533 <tag-name id="process_argv"><literal>process.argv</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
534 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
535 Возвращает массив, содержащий аргументы командной строки, |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
536 передаваемые в момент запуска текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
537 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
538 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
539 <tag-name id="process_env"><literal>process.env</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
540 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
541 Возвращает объект, содержащий переменные окружения пользователя. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
542 <note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
543 По умолчанию nginx удаляет все переменные окружения, унаследованные |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
544 от своего родительского процесса, кроме переменной TZ. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
545 Для сохранения части унаследованных переменных |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
546 необходимо использовать директиву <link doc="../ngx_core_module.xml" id="env"/>. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
547 </note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
548 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
549 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
550 <tag-name id="process_pid"><literal>process.pid</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
551 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
552 Возвращает PID текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
553 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
554 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
555 <tag-name id="process_ppid"><literal>process.ppid</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
556 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
557 Возвращает PID текущего родительского процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
558 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
559 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
560 </list> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
561 </para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
562 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
563 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
564 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
565 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
566 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
567 |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
568 <section id="string" name="String"> |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
569 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
570 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
571 В njs существует два типа строк: строка Unicode (по умолчанию) и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
572 байтовая строка. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
573 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
574 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
575 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
576 Строка Unicode соответствует строке ECMAScript, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
577 содержащей символы Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
578 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
579 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
580 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
581 Байтовые строки содержат последовательность байт и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
582 используются для сериализации строк Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
583 во внешние данные и десериализации из внешних источников. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
584 Например метод <link id="string_toutf8">toUTF8()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
585 строку Unicode в байтовую строку используя кодировку UTF8: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
586 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
587 >> '£'.toUTF8().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
588 'c2a3' /* C2 A3 является UTF8-представлением codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
589 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
590 Метод <link id="string_tobytes">toBytes()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
591 строку Unicode с codepoints до 255 в байтовую строку, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
592 в противном случае возвращается <literal>null</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
593 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
594 >> '£'.toBytes().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
595 'a3' /* a3 является байтом, равным codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
596 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
597 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
598 <list type="tag"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
599 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
600 <tag-name id="string_bytesfrom"><literal>String.bytesFrom(<value>массив</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
601 | <value>строка</value>, <value>кодировка</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
602 <tag-desc> |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
603 Создаёт байтовую строку или из массива, содержащего октеты, |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
604 или из кодированной строки |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
605 (<link doc="changes.xml" id="njs0.2.3">0.2.3</link>). |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
606 Кодировкой может быть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
607 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
608 <literal>base64</literal> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
609 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
610 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
611 >> String.bytesFrom([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
612 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
613 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
614 >> String.bytesFrom('YnVmZmVy', 'base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
615 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
616 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
617 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
618 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
619 <tag-name id="string_frombytes"><literal>String.prototype.fromBytes(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
620 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
621 <tag-desc> |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
622 Возвращает новую строку Unicode из байтовой строки, |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
623 в которой каждый байт заменяется соответствующей Unicode codepoint. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
624 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
625 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
626 <tag-name id="string_fromutf8"><literal>String.prototype.fromUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
627 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
628 <tag-desc> |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
629 Преобразует байтовую строку, содержащую валидную строку UTF8, |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
630 в строку Unicode, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
631 иначе возвращается <literal>null</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
632 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
633 |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
634 <tag-name id="string_tobytes"><literal>String.prototype.toBytes(<value>начало</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
635 <value>конец</value>])</literal></tag-name> |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
636 <tag-desc> |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
637 Сериализует строку Unicode в байтовую строку. |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
638 Возвращает <literal>null</literal>, если в строке найден символ больше, чем 255. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
639 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
640 |
2582
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
641 <tag-name id="string_tostring"><literal>String.prototype.toString(<value>кодировка</value>)</literal></tag-name> |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
642 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
643 <para> |
2582
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
644 Кодирует указанную строку в |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
645 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
646 <literal>base64</literal> или |
2582
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
647 <literal>base64url</literal>: |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
648 <example> |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
649 >> 'αβγδ'.toString('base64url') |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
650 'zrHOss6zzrQ' |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
651 </example> |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
652 До версии <link doc="changes.xml" id="njs0.4.3">0.4.3</link> |
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
653 могла быть кодирована только <link id="string_tobytes">байтовая строка</link>: |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
654 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
655 >> 'αβγδ'.toUTF8().toString('base64url') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
656 'zrHOss6zzrQ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
657 </example> |
2582
e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2580
diff
changeset
|
658 </para> |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
659 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
660 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
661 <tag-name id="string_toutf8"><literal>String.prototype.toUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
662 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
663 <tag-desc> |
2569
2edc64c05b0e
Removed ECMAScript methods from njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2546
diff
changeset
|
664 Сериализует строку Unicode |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
665 в байтовую строку при помощи кодирования UTF8. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
666 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
667 >> 'αβγδ'.toUTF8().length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
668 8 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
669 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
670 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
671 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
672 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
673 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
674 </list> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
675 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
676 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
677 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
678 |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
679 |
2585
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
680 <section id="textdecoder" name="Text Decoder"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
681 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
682 <para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
683 Объект <literal>TextDecoder</literal> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
684 создаёт поток кодовых точек из потока данных |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
685 (<link doc="changes.xml" id="njs0.4.3">0.4.3</link>). |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
686 </para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
687 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
688 <para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
689 <list type="tag"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
690 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
691 <tag-name><literal>TextDecoder([[<value>кодировка</value>], |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
692 <value>options</value>])</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
693 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
694 Создаёт новый объект <literal>TextDecoder</literal> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
695 для указанной <literal>кодировки</literal>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
696 на данный момент поддерживается только UTF-8. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
697 Параметр <literal>options</literal> является |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
698 словарём <literal>TextDecoderOption</literal> со свойствами: |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
699 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
700 <list type="tag"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
701 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
702 <tag-name><literal>fatal</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
703 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
704 логический флаг, указывающий, что |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
705 <link id="textdecoder_decode"><literal>TextDecoder.decode()</literal></link> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
706 должен вызывать исключение <value>TypeError</value> в случае, если |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
707 найдена ошибка кодирования, по умолчанию <literal>false</literal>. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
708 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
709 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
710 </list> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
711 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
712 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
713 <tag-name id="textdecoder_encoding"><literal>TextDecoder.prototype.encoding</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
714 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
715 Возвращает строку с именем кодировки, используемой |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
716 <link id="textdecoder"><literal>TextDecoder()</literal></link>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
717 только чтение. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
718 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
719 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
720 <tag-name id="textdecoder_fatal"><literal>TextDecoder.prototype.fatal</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
721 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
722 логический флаг, <literal>true</literal>, если |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
723 генерируется ошибка для невалидных символов, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
724 только чтение. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
725 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
726 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
727 <tag-name id="textdecoder_ignorebom"><literal>TextDecoder.prototype.ignoreBOM</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
728 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
729 логический флаг, <literal>true</literal>, если |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
730 игнорируется маркер порядка следования байтов, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
731 только чтение. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
732 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
733 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
734 <tag-name id="textdecoder_decode"><literal>TextDecoder.prototype.decode(<value>буфер</value>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
735 [<value>options</value>])</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
736 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
737 Возвращает строку с текстом, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
738 декодированным из <literal>буфера</literal> при помощи |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
739 <link id="textdecoder"><literal>TextDecoder()</literal></link>. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
740 Буфером может быть |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
741 <literal>ArrayBuffer</literal>. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
742 Параметром <literal>options</literal> является |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
743 словарь <literal>TextDecodeOptions</literal> со свойствами: |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
744 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
745 <list type="tag"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
746 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
747 <tag-name><literal>stream</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
748 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
749 логический флаг, указывающий, что |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
750 при последующих вызовах <literal>decode()</literal> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
751 должны последовать дополнительные данные: |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
752 <literal>true</literal>, если данные обрабатываются блоками, и |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
753 <literal>false</literal> для последнего блока |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
754 или если данные не передаются блоками. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
755 По умолчанию <literal>false</literal>. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
756 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
757 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
758 </list> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
759 <example> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
760 >> (new TextDecoder()).decode(new Uint8Array([206,177,206,178])) |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
761 αβ |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
762 </example> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
763 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
764 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
765 </list> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
766 </para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
767 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
768 </section> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
769 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
770 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
771 <section id="textencoder" name="Text Encoder"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
772 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
773 <para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
774 Объект <literal>TextEncoder</literal> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
775 создаёт поток данных в кодировке UTF-8 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
776 из потока кодовых точек |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
777 (<link doc="changes.xml" id="njs0.4.3">0.4.3</link>). |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
778 </para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
779 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
780 <para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
781 <list type="tag"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
782 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
783 <tag-name><literal>TextEncoder()</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
784 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
785 Возвращает только что созданный <literal>TextEncoder</literal>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
786 который создаёт поток данных в кодировке UTF-8. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
787 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
788 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
789 <tag-name id="textencoder_encoding"><literal>TextEncoder.prototype.encoding</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
790 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
791 Возвращает “<value>utf-8</value>”, только для чтения. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
792 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
793 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
794 <tag-name id="textencoder_encode"><literal>TextEncoder.prototype.encode(<value>строка</value>)</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
795 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
796 Кодирует <literal>строку</literal> в <literal>Uint8Array</literal>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
797 содержащий текст в кодировке UTF-8. |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
798 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
799 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
800 <tag-name id="textencoder_encodeinto"><literal>TextEncoder.prototype.encodeInto(<value>строка</value>, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
801 <value>uint8Array</value>)</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
802 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
803 Преобразует <literal>строку</literal> в UTF-8, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
804 сохраняет результат в целевом <literal>Uint8Array</literal> и |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
805 возвращает объект словаря, отражающий прогресс кодирования, со свойствами: |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
806 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
807 <list type="tag"> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
808 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
809 <tag-name><literal>read</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
810 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
811 количество блоков кода UTF-16 из исходной строки, |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
812 преобразованных в UTF-8 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
813 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
814 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
815 <tag-name><literal>written</literal></tag-name> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
816 <tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
817 количество байтов, преобразованных в целевом <literal>Uint8Array</literal> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
818 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
819 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
820 </list> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
821 </tag-desc> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
822 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
823 </list> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
824 </para> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
825 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
826 </section> |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
827 |
7035221dbe37
Documented TextDecoder and TextEncoder in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2583
diff
changeset
|
828 |
2580
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
829 <section id="njs_api_timers" name="Timers"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
830 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
831 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
832 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
833 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
834 <tag-name id="cleartimeout"><literal>clearTimeout(<value>timeout</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
835 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
836 Отменяет объект <literal>timeout</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
837 созданный <link id="settimeout"><literal>setTimeout()</literal></link>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
838 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
839 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
840 <tag-name id="settimeout"><literal>setTimeout(<value>функция</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
841 <value>миллисекунды</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
842 <value>аргумент1</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
843 <value>аргументN</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
844 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
845 Вызывает <literal>функцию</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
846 по прошествии указанного количества <literal>миллисекунд</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
847 Указанной функции можно передать |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
848 один или более необязательных <literal>аргументов</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
849 Возвращает объект <literal>timeout</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
850 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
851 function handler(v) |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
852 { |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
853 // ... |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
854 } |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
855 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
856 t = setTimeout(handler, 12); |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
857 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
858 // ... |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
859 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
860 clearTimeout(t); |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
861 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
862 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
863 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
864 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
865 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
866 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
867 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
868 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
869 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
870 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
871 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
872 <section id="built-in" name="Встроенные модули"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
873 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
874 <section id="crypto" name="Crypto"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
875 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
876 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
877 Модуль Crypto предоставляет поддержку криптографических функций. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
878 Объект модуля Crypto доступен через <literal>require('crypto')</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
879 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
880 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
881 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
882 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
883 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
884 <tag-name id="crypto_createhash"><literal>crypto.createHash(<value>алгоритм</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
885 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
886 Создаёт и возвращает объект <link id="crypto_hash">Hash</link>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
887 который может использоваться для создания hash digests |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
888 при помощи указанного <value>алгоритма</value>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
889 Алгоритмом может быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
890 <literal>md5</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
891 <literal>sha1</literal> и |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
892 <literal>sha256</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
893 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
894 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
895 <tag-name id="crypto_createhmac"><literal>crypto.createHmac(<value>алгоритм</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
896 <value>секретный ключ</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
897 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
898 Создаёт и возвращает объект <link id="crypto_hmac">HMAC</link>, который |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
899 использует заданный <value>алгоритм</value> и <value>секретный ключ</value>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
900 Алгоритм может быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
901 <literal>md5</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
902 <literal>sha1</literal> и |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
903 <literal>sha256</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
904 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
905 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
906 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
907 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
908 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
909 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
910 <section id="crypto_hash" name="Hash"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
911 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
912 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
913 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
914 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
915 <tag-name><literal>hash.update(<value>данные</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
916 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
917 Обновляет содержимое хэша с передаваемыми <value>данными</value>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
918 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
919 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
920 <tag-name><literal>hash.digest([<value>кодировка</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
921 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
922 Подсчитывает дайджест всех данных, передаваемых при помощи |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
923 <literal>hash.update()</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
924 Кодировка может быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
925 <literal>hex</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
926 <literal>base64</literal> и |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
927 <literal>base64url</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
928 Если кодировка не указана, то будет возвращена байтовая строка. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
929 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
930 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
931 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
932 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
933 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
934 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
935 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
936 >> var cr = require('crypto') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
937 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
938 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
939 >> cr.createHash('sha1').update('A').update('B').digest('base64url') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
940 'BtlFlCqiamG-GMPiK_GbvKjdK10' |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
941 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
942 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
943 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
944 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
945 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
946 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
947 <section id="crypto_hmac" name="HMAC"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
948 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
949 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
950 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
951 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
952 <tag-name><literal>hmac.update(<value>данные</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
953 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
954 Обновляет содержимое HMAC с передаваемыми <value>данными</value>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
955 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
956 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
957 <tag-name><literal>hmac.digest([<value>кодировка</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
958 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
959 Подсчитывает HMAC-дайджест всех данных, передаваемых при помощи |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
960 <literal>hmac.update()</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
961 Кодировка может быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
962 <literal>hex</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
963 <literal>base64</literal> и |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
964 <literal>base64url</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
965 Если кодировка не указана, то будет возвращена байтовая строка. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
966 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
967 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
968 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
969 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
970 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
971 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
972 >> var cr = require('crypto') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
973 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
974 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
975 >> cr.createHmac('sha1', 'secret.key').update('AB').digest('base64url') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
976 'Oglm93xn23_MkiaEq_e9u8zk374' |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
977 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
978 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
979 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
980 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
981 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
982 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
983 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
984 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
985 <section id="njs_api_fs" name="File System"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
986 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
987 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
988 Модуль File System предоставляет набор функций для операций с файлами. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
989 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
990 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
991 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
992 Объект модуля доступен через <literal>require('fs')</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
993 Начиная с версии <link doc="changes.xml" id="njs0.3.9">0.3.9</link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
994 доступны промисифицированные версии методов file system через |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
995 объект <literal>require('fs').promises</literal>: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
996 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
997 > var fs = require('fs').promises; |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
998 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
999 > fs.readFile("/file/path").then((data)=>console.log(data)) |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1000 <file data> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1001 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1002 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1003 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1004 <tag-name id="fs_accesssync"><literal>accessSync(<value>путь</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1005 <value>mode</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1006 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1007 Синхронно проверяет разрешения для файла или каталога, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1008 указанного в <literal>пути</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1009 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1010 Если проверка не удалась, то будет возвращена ошибка, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1011 в противном случае метод возвратит undefined. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1012 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1013 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1014 <tag-name><literal>mode</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1015 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1016 По умолчанию |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1017 <link id="access_const"><literal>fs.constants.F_OK</literal></link>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1018 Является необязательным числом, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1019 которое задаёт выполнение проверок доступа. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1020 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1021 try { |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1022 fs.accessSync('/file/path', fs.constants.R_OK | fs.constants.W_OK); |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1023 console.log('has access'); |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1024 } catch (e) { |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1025 console.log('no access');) |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1026 } |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1027 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1028 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1029 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1030 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1031 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1032 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1033 <tag-name id="fs_appendfilesync"><literal>appendFileSync(<value>имяФайла</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1034 <value>данные</value>[, <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1035 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1036 Синхронно добавляет указанные <literal>данные</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1037 в файл с указанным <literal>именем</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1038 Если файл не существует, то он будет создан. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1039 Параметр <literal>options</literal> должен быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1040 объектом со следующими ключами: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1041 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1042 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1043 <tag-name><literal>режим</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1044 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1045 режим, по умолчанию <literal>0o666</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1046 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1047 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1048 <tag-name><literal>флаг</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1049 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1050 <link id="njs_api_fs_flags">флаг</link> файловой системы, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1051 по умолчанию <literal>a</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1052 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1053 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1054 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1055 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1056 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1057 <tag-name id="fs_mkdirsync"><literal>mkdirSync(<value>путь</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1058 <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1059 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1060 Синхронно создаёт каталог по указанному <literal>пути</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1061 (<link doc="changes.xml" id="njs0.4.2">0.4.2</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1062 Параметр <literal>options</literal> должен быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1063 <literal>числом</literal>, которое задаёт |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1064 <link id="fs_mkdirsync_mode">режим</link>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1065 или объектом с ключами: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1066 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1067 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1068 <tag-name id="fs_mkdirsync_mode"><literal>режим</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1069 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1070 режим, по умолчанию <literal>0o777</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1071 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1072 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1073 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1074 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1075 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1076 <tag-name id="fs_readdirsync"><literal>readdirSync(<value>путь</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1077 <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1078 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1079 Синхронно читает содержимое каталога |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1080 по указанному <literal>пути</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1081 (<link doc="changes.xml" id="njs0.4.2">0.4.2</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1082 Параметр <literal>options</literal> должен быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1083 строкой, определяющей <link id="fs_readdirsync_encoding">кодировку</link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1084 или объектом с ключами: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1085 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1086 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1087 <tag-name id="fs_readdirsync_encoding"><literal>кодировка</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1088 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1089 кодировка, по умолчанию не указана. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1090 Кодировка может быть <literal>utf8</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1091 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1092 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1093 <tag-name id="fs_readdirsync_withfiletypes"><literal>withFileTypes</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1094 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1095 если <literal>true</literal>, то массив файлов будет содержать |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1096 объекты <link id="fs_dirent"><literal>fs.Dirent</literal></link>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1097 по умолчанию <literal>false</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1098 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1099 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1100 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1101 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1102 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1103 <tag-name id="fs_readfilesync"><literal>readFileSync(<value>имяФайла</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1104 <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1105 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1106 Синхронно возвращает содержимое файла |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1107 с указанным <literal>именем</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1108 Параметр <literal>options</literal> хранит |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1109 <literal>строку</literal>, которая задаёт кодировку. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1110 Если кодировка не указана, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1111 то будет возвращена <link id="string_tobytes">байтовая строка</link>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1112 Если указана кодировка <literal>utf8</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1113 то будет возвращена строка Unicode. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1114 Иначе ожидается, что <literal>options</literal> является |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1115 объектом с ключами: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1116 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1117 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1118 <tag-name><literal>кодировка</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1119 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1120 кодировка, по умолчанию не указана. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1121 Кодировка может быть <literal>utf8</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1122 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1123 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1124 <tag-name><literal>флаг</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1125 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1126 <link id="njs_api_fs_flags">флаг</link> файловой системы, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1127 по умолчанию <literal>r</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1128 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1129 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1130 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1131 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1132 >> var fs = require('fs') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1133 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1134 >> var file = fs.readFileSync('/file/path.tar.gz') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1135 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1136 >> var gzipped = /^\x1f\x8b/.test(file); gzipped |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1137 true |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1138 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1139 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1140 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1141 <tag-name id="fs_realpathsync"><literal>realpathSync(<value>путь</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1142 <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1143 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1144 Синхронно вычисляет канонический путь при помощи преобразования |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1145 <literal>.</literal>, <literal>..</literal> и символических ссылок используя |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1146 <link url="http://man7.org/linux/man-pages/man3/realpath.3.html">realpath(3)</link>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1147 Аргумент <literal>options</literal> может быть строкой, определяющей кодировку, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1148 или объектом со свойством encoding, определяющим символьную кодировку, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1149 которая используется для передачи пути обратному вызову |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1150 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1151 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1152 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1153 <tag-name id="fs_renamesync"><literal>renameSync(<value>старыйПуть</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1154 <value>новыйПуть</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1155 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1156 Синхронно меняет имя или местоположение файла. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1157 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1158 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1159 >> var fs = require('fs') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1160 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1161 >> var file = fs.renameSync('hello.txt', 'HelloWorld.txt') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1162 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1163 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1164 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1165 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1166 <tag-name id="fs_rmdirsync"><literal>rmdirSync(<value>путь</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1167 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1168 Синхронно удаляет каталог по указанному <literal>пути</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1169 (<link doc="changes.xml" id="njs0.4.2">0.4.2</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1170 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1171 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1172 <tag-name id="fs_symlinksync"><literal>symlinkSync(<value>цель</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1173 <value>path</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1174 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1175 Синхронно создаёт ссылку с именем <literal>путь</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1176 указывающую на <literal>цель</literal> при помощи |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1177 <link url="http://man7.org/linux/man-pages/man2/symlink.2.html">symlink(2)</link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1178 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1179 Относительные цели считаются относительно корневого каталога ссылки. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1180 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1181 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1182 <tag-name id="fs_unlinksync"><literal>unlinkSync(<value>путь</value>)</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1183 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1184 Синхронно удаляет файл по указанному <literal>пути</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1185 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>). |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1186 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1187 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1188 <tag-name id="fs_writefilesync"><literal>writeFileSync(<value>имяФайла</value>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1189 <value>данные</value>[, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1190 <value>options</value>])</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1191 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1192 Синхронно записывает <literal>данные</literal> в файл |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1193 с указанным <literal>именем</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1194 Если файл не существует, то он будет создан. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1195 Если файл существует, то он будет заменён. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1196 Параметр <literal>options</literal> должен быть |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1197 объектом с ключами: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1198 <list type="tag"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1199 <tag-name><literal>режим</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1200 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1201 режим, по умолчанию <literal>0o666</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1202 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1203 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1204 <tag-name><literal>флаг</literal></tag-name> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1205 <tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1206 <link id="njs_api_fs_flags">флаг</link> файловой системы, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1207 по умолчанию <literal>w</literal> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1208 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1209 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1210 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1211 <example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1212 >> var fs = require('fs') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1213 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1214 >> var file = fs.writeFileSync('hello.txt', 'Hello world') |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1215 undefined |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1216 </example> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1217 </tag-desc> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1218 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1219 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1220 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1221 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1222 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1223 <section id="fs_dirent" name="fs.Dirent"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1224 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1225 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1226 <literal>fs.Dirent</literal> является представлением записи каталога— |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1227 файлом или подкаталогом . |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1228 В случае, если |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1229 <link id="fs_readdirsync"><literal>readdirSync()</literal></link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1230 вызывается с опцией |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1231 <link id="fs_readdirsync_withfiletypes"><literal>withFileTypes</literal></link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1232 получившийся массив содержит объекты <literal>fs.Dirent</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1233 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1234 <list type= "bullet" compact="no"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1235 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1236 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1237 <literal>dirent.isBlockDevice()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1238 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1239 блочное устройство |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1240 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1241 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1242 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1243 <literal>dirent.isCharacterDevice()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1244 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1245 символьное устройство. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1246 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1247 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1248 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1249 <literal>dirent.isDirectory()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1250 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1251 каталог файловой системы. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1252 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1253 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1254 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1255 <literal>dirent.isFIFO()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1256 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1257 FIFO-канал. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1258 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1259 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1260 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1261 <literal>dirent.isFile()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1262 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1263 обычный файл. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1264 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1265 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1266 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1267 <literal>dirent.isSocket()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1268 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1269 сокет. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1270 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1271 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1272 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1273 <literal>dirent.isSymbolicLink()</literal>—возвращает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1274 <literal>true</literal>, если объект <literal>fs.Dirent</literal> описывает |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1275 символическую ссылку. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1276 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1277 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1278 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1279 <literal>dirent.name</literal>— |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1280 имя файла, на которое ссылается объект <literal>fs.Dirent</literal>. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1281 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1282 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1283 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1284 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1285 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1286 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1287 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1288 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1289 <section id="access_const" name="Константы доступа к файлу"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1290 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1291 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1292 Метод <link id="fs_accesssync"><literal>access()</literal></link> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1293 может принимать следующие флаги. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1294 Флаги экспортируются при помощи <literal>fs.constants</literal>: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1295 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1296 <list type= "bullet" compact="no"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1297 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1298 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1299 <literal>F_OK</literal>—указывает, что файл может |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1300 быть видимым для для вызывающего процесса, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1301 используется по умолчанию, если режим не указан |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1302 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1303 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1304 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1305 <literal>R_OK</literal>—указывает, что файл может |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1306 читаться вызывающим процессом |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1307 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1308 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1309 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1310 <literal>W_OK</literal>—указывает, что файл может |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1311 записываться вызывающим процессом |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1312 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1313 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1314 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1315 <literal>X_OK</literal>—указывает, что файл может |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1316 выполняться вызывающим процессом |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1317 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1318 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1319 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1320 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1321 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1322 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1323 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1324 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1325 <section id="njs_api_fs_flags" name="Флаги файловой системы"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1326 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1327 <para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1328 Опция <literal>флаг</literal> может принимать следующие значения: |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1329 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1330 <list type= "bullet" compact="no"> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1331 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1332 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1333 <literal>a</literal>—открытие файла для добавления данных. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1334 Если файл не существует, то он будет создан |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1335 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1336 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1337 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1338 <literal>ax</literal>—то же, что и <literal>a</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1339 но завершится неудачей, если файл существует |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1340 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1341 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1342 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1343 <literal>a+</literal>—открытие файла для чтения и добавления данных. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1344 Если файл не существует, то он будет создан |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1345 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1346 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1347 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1348 <literal>ax+</literal>—то же, что и <literal>a+</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1349 но завершится неудачей, если файл существует |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1350 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1351 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1352 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1353 <literal>as</literal>—открытие файла для добавления данных |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1354 в синхронном режиме. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1355 Если файл не существует, то он будет создан |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1356 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1357 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1358 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1359 <literal>as+</literal>—открытие файла для чтения и добавления данных |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1360 в синхронном режиме. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1361 Если файл не существует, то он будет создан |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1362 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1363 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1364 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1365 <literal>r</literal>— открытие файла для чтения. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1366 Если файл не существует, то возникнет исключение |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1367 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1368 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1369 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1370 <literal>r+</literal>—открытие файла для чтения и записи. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1371 Если файл не существует, то возникнет исключение |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1372 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1373 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1374 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1375 <literal>rs+</literal>—открытие файла для чтения и записи |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1376 в синхронном режиме. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1377 Указывает операционной системе не использовать кэш локальной файловой системы |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1378 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1379 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1380 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1381 <literal>w</literal>—открытие файла для записи. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1382 Если файл не существует, то он будет создан. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1383 Если файл существует, то он будет заменён. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1384 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1385 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1386 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1387 <literal>wx</literal>—то же, что и <literal>w</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1388 но завершится неудачей, если файл существует |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1389 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1390 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1391 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1392 <literal>w+</literal>—открытие файла для чтения и записи. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1393 Если файл не существует, то он будет создан. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1394 Если файл существует, то он будет заменён. |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1395 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1396 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1397 <listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1398 <literal>wx+</literal>—то же, что и <literal>w+</literal>, |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1399 но завершится неудачей, если файл существует |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1400 </listitem> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1401 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1402 </list> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1403 </para> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1404 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1405 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1406 |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1407 </section> |
28f98f596974
Translated the rest of njs Reference into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2570
diff
changeset
|
1408 |
2583
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1409 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1410 <section id="querystring" name="Query String"> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1411 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1412 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1413 Модуль Query String предоставляет поддержку |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1414 синтаксического разбора и форматирования строки запроса URL. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1415 (<link doc="changes.xml" id="njs0.4.3">0.4.3</link>). |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1416 Объект модуля Query String доступен через |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1417 <literal>require('querystring')</literal>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1418 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1419 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1420 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1421 <list type="tag"> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1422 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1423 <tag-name id="querystring_decode"><literal>querystring.decode()</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1424 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1425 является псевдонимом для |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1426 <link id="querystring_parse"><literal>querystring.parse()</literal></link>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1427 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1428 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1429 <tag-name id="querystring_encode"><literal>querystring.encode()</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1430 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1431 является псевдонимом для |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1432 <link id="querystring_stringify"><literal>querystring.stringify()</literal></link>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1433 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1434 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1435 <tag-name id="querystring_escape"><literal>querystring.escape(<value>строка</value>)</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1436 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1437 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1438 Кодирует заданную <literal>строку</literal>, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1439 возвращает экранированную строку. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1440 Метод используется методом |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1441 <link id="querystring_stringify"><literal>querystring.stringify()</literal></link> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1442 и не должен использоваться напрямую. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1443 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1444 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1445 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1446 <tag-name id="querystring_parse"><literal>querystring.parse(<value>строка</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1447 <value>separator</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1448 <value>equal</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1449 <value>options</value>]]])</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1450 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1451 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1452 Осуществляет синтаксический разбор строки запроса и возвращает объект. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1453 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1454 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1455 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1456 Параметр <literal>separator</literal> является подстрокой, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1457 разделяющей в строке запроса пары ключей и значений, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1458 по умолчанию “<literal>&</literal>”. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1459 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1460 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1461 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1462 Параметр <literal>equal</literal> является подстрокой, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1463 разделяющей в строке запроса ключи и значения, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1464 по умолчанию “<literal>=</literal>”. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1465 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1466 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1467 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1468 Параметр <literal>options</literal> должен быть |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1469 объектом со следующими ключами: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1470 <list type="tag"> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1471 <tag-name><literal>decodeURIComponent</literal> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1472 <value>функция</value></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1473 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1474 Функция, используемая |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1475 при декодировании процентно-кодированных символов в строке запроса, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1476 по умолчанию |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1477 <link id="querystring_unescape"><literal>querystring.unescape()</literal></link> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1478 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1479 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1480 <tag-name><literal>maxKeys</literal> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1481 <value>число</value></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1482 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1483 максимальное число ключей для синтаксического разбора, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1484 по умолчанию <literal>1000</literal>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1485 Значение <literal>0</literal> удаляет ограничение на подсчёт ключей. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1486 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1487 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1488 </list> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1489 По умолчанию предполагается, что процентно-кодированные символы в строке запроса |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1490 используют кодировку UTF-8, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1491 неверная последовательность байтов UTF-8 будет заменена на |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1492 <literal>U+FFFD</literal>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1493 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1494 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1495 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1496 Пример для строки запроса: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1497 <example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1498 'foo=bar&abc=xyz&abc=123' |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1499 </example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1500 результат: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1501 <example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1502 { |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1503 foo: 'bar', |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1504 abc: ['xyz', '123'] |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1505 } |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1506 </example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1507 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1508 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1509 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1510 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1511 <tag-name id="querystring_stringify"><literal>querystring.stringify(<value>object</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1512 <value>separator</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1513 <value>equal</value>[, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1514 <value>options</value>]]])</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1515 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1516 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1517 Осуществляет синтаксический разбор объекта и возвращает строку запроса. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1518 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1519 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1520 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1521 Параметр <literal>separator</literal> является подстрокой, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1522 разделяющей в строке запроса пары ключей и значений, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1523 по умолчанию “<literal>&</literal>”. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1524 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1525 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1526 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1527 Параметр <literal>equal</literal> является подстрокой, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1528 разделяющей в строке запроса ключи и значения, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1529 по умолчанию “<literal>=</literal>”. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1530 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1531 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1532 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1533 Параметр <literal>options</literal> должен быть |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1534 объектом со следующими ключами: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1535 <list type="tag"> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1536 <tag-name><literal>encodeURIComponent</literal> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1537 <value>функция</value></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1538 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1539 Функция, используемая при декодировании |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1540 URL-небезопасных символов в в процентно-кодированные символы в строке запроса, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1541 по умолчанию |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1542 <link id="querystring_escape"><literal>querystring.escape()</literal></link>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1543 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1544 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1545 </list> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1546 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1547 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1548 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1549 По умолчанию символы, требующие процентной кодировки внутри строки запроса, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1550 кодируются в UTF-8. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1551 Если требуется другая кодировка, то |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1552 необходимо указать опцию <literal>encodeURIComponent</literal>. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1553 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1554 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1555 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1556 Пример: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1557 <example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1558 querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], 123: '' }); |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1559 </example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1560 результат: |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1561 <example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1562 'foo=bar&baz=qux&baz=quux&123=' |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1563 </example> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1564 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1565 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1566 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1567 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1568 <tag-name id="querystring_unescape"><literal>querystring.unescape(<value>строка</value>)</literal></tag-name> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1569 <tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1570 <para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1571 Осуществляет декодирование процентно-кодированных символов URL |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1572 в <literal>строке</literal>, |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1573 возвращает неэкранированную строку запроса. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1574 Метод используется методом |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1575 <link id="querystring_parse"><literal>querystring.parse()</literal></link> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1576 и не должен использоваться напрямую. |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1577 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1578 </tag-desc> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1579 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1580 </list> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1581 </para> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1582 |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1583 </section> |
cd97adddd757
Documented Query String in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2582
diff
changeset
|
1584 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
1585 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
1586 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1587 </article> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1588 |