comparison xml/en/docs/njs/reference.xml @ 2508:d3d5b67a1462

Language fixes in njs file system methods.
author Yaroslav Zhuravlev <yar@nginx.com>
date Wed, 04 Mar 2020 11:30:48 +0000
parents 8ad2ea80e0c2
children 827a6d7fe108
comparison
equal deleted inserted replaced
2507:8ad2ea80e0c2 2508:d3d5b67a1462
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Reference" 9 <article name="Reference"
10 link="/en/docs/njs/reference.html" 10 link="/en/docs/njs/reference.html"
11 lang="en" 11 lang="en"
12 rev="36"> 12 rev="37">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 <link doc="index.xml">njs</link> provides objects, methods and properties 17 <link doc="index.xml">njs</link> provides objects, methods and properties
1174 The File System module provides operations with files. 1174 The File System module provides operations with files.
1175 </para> 1175 </para>
1176 1176
1177 <para> 1177 <para>
1178 The module object is returned by <literal>require('fs')</literal>. 1178 The module object is returned by <literal>require('fs')</literal>.
1179 Since (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>), 1179 Since <link doc="changes.xml" id="njs0.3.9">0.3.9</link>,
1180 promissified versions of methods described below are available through 1180 promissified versions of file system methods are available through
1181 <literal>require('fs').promises</literal> object: 1181 <literal>require('fs').promises</literal> object:
1182 <example> 1182 <example>
1183 > var fs = require('fs').promises; 1183 > var fs = require('fs').promises;
1184 undefined 1184 undefined
1185 > fs.readFile("/file/path").then((data)=>console.log(data)) 1185 > fs.readFile("/file/path").then((data)=>console.log(data))
1278 <tag-name id="fs_realpathsync"><literal>realpathSync(<value>path</value>[, 1278 <tag-name id="fs_realpathsync"><literal>realpathSync(<value>path</value>[,
1279 <value>options</value>])</literal></tag-name> 1279 <value>options</value>])</literal></tag-name>
1280 <tag-desc> 1280 <tag-desc>
1281 Synchronously computes the canonical pathname by resolving 1281 Synchronously computes the canonical pathname by resolving
1282 <literal>.</literal>, <literal>..</literal> and symbolic links using 1282 <literal>.</literal>, <literal>..</literal> and symbolic links using
1283 <link url="http://man7.org/linux/man-pages/man3/realpath.3.html">realpath(3)</link> 1283 <link url="http://man7.org/linux/man-pages/man3/realpath.3.html">realpath(3)</link>.
1284 The <literal>options</literal> argument can be a string specifying an encoding, 1284 The <literal>options</literal> argument can be a string specifying an encoding,
1285 or an object with an encoding property specifying the character encoding 1285 or an object with an encoding property specifying the character encoding
1286 to use for the path passed to the callback 1286 to use for the path passed to the callback
1287 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>). 1287 (<link doc="changes.xml" id="njs0.3.9">0.3.9</link>).
1288 </tag-desc> 1288 </tag-desc>