Mercurial > hg > nginx-site
comparison xml/en/docs/njs/reference.xml @ 2414:3b7223f9aac8
njs-0.3.4
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 13 Aug 2019 18:09:40 +0300 |
parents | dbf68c949522 |
children | 080581ce888d |
comparison
equal
deleted
inserted
replaced
2413:c6581f9aefa3 | 2414:3b7223f9aac8 |
---|---|
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="29"> | 12 rev="30"> |
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 |
852 <tag-desc> | 852 <tag-desc> |
853 Removes whitespaces from both ends of a string. | 853 Removes whitespaces from both ends of a string. |
854 <example> | 854 <example> |
855 >> ' abc '.trim() | 855 >> ' abc '.trim() |
856 'abc' | 856 'abc' |
857 </example> | |
858 </tag-desc> | |
859 | |
860 <tag-name id="string_trimend"><literal>String.prototype.trimEnd()</literal></tag-name> | |
861 <tag-desc> | |
862 Removes whitespaces from the end of a string | |
863 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
864 <example> | |
865 >> ' abc '.trimEnd() | |
866 ' abc' | |
867 </example> | |
868 </tag-desc> | |
869 | |
870 <tag-name id="string_trimstart"><literal>String.prototype.trimStart()</literal></tag-name> | |
871 <tag-desc> | |
872 Removes whitespaces from the beginning of a string | |
873 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
874 <example> | |
875 >> ' abc '.trimStart() | |
876 'abc ' | |
857 </example> | 877 </example> |
858 </tag-desc> | 878 </tag-desc> |
859 | 879 |
860 <tag-name id="encodeuri"><literal>encodeURI(<value>URI</value>)</literal></tag-name> | 880 <tag-name id="encodeuri"><literal>encodeURI(<value>URI</value>)</literal></tag-name> |
861 <tag-desc> | 881 <tag-desc> |
1215 >> var file = fs.writeFileSync('hello.txt', 'Hello world') | 1235 >> var file = fs.writeFileSync('hello.txt', 'Hello world') |
1216 undefined | 1236 undefined |
1217 </example> | 1237 </example> |
1218 </tag-desc> | 1238 </tag-desc> |
1219 | 1239 |
1240 <tag-name id="renamesync"><literal>renameSync(<value>oldPath</value>, | |
1241 <value>newPath</value>)</literal></tag-name> | |
1242 <tag-desc> | |
1243 Synchronously changes the name or location of a file from | |
1244 <literal>oldPath</literal> to <literal>newPath</literal> | |
1245 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
1246 <example> | |
1247 >> var fs = require('fs') | |
1248 undefined | |
1249 >> var file = fs.renameSync('hello.txt', 'HelloWorld.txt') | |
1250 undefined | |
1251 </example> | |
1252 </tag-desc> | |
1253 | |
1220 </list> | 1254 </list> |
1221 </para> | 1255 </para> |
1222 | 1256 |
1223 | 1257 |
1224 <section id="njs_api_fs_flags" name="File System Flags"> | 1258 <section id="njs_api_fs_flags" name="File System Flags"> |