Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-21 17:38:31 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-25 00:06:00 +0300
commite2c3e4727d5899a709f5c421e128a4af2ef626f3 (patch)
treeda562d9848f3b66dddd2f244972a5cbc672fda20 /doc/api/path.md
parentb6d293d2158c66a3edbb86c0c43b4c51af3484f7 (diff)
doc: conform to rules for eslint-plugin-markdown
PR-URL: https://github.com/nodejs/node/pull/12563 Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Diffstat (limited to 'doc/api/path.md')
-rw-r--r--doc/api/path.md74
1 files changed, 37 insertions, 37 deletions
diff --git a/doc/api/path.md b/doc/api/path.md
index a6f1701261b..d9452b00dbf 100644
--- a/doc/api/path.md
+++ b/doc/api/path.md
@@ -74,10 +74,10 @@ the Unix `basename` command. Trailing directory separators are ignored, see
For example:
```js
-path.basename('/foo/bar/baz/asdf/quux.html')
+path.basename('/foo/bar/baz/asdf/quux.html');
// Returns: 'quux.html'
-path.basename('/foo/bar/baz/asdf/quux.html', '.html')
+path.basename('/foo/bar/baz/asdf/quux.html', '.html');
// Returns: 'quux'
```
@@ -99,21 +99,21 @@ Provides the platform-specific path delimiter:
For example, on POSIX:
```js
-console.log(process.env.PATH)
+console.log(process.env.PATH);
// Prints: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'
-process.env.PATH.split(path.delimiter)
+process.env.PATH.split(path.delimiter);
// Returns: ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']
```
On Windows:
```js
-console.log(process.env.PATH)
+console.log(process.env.PATH);
// Prints: 'C:\Windows\system32;C:\Windows;C:\Program Files\node\'
-process.env.PATH.split(path.delimiter)
-// Returns: ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\']
+process.env.PATH.split(path.delimiter);
+// Returns ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\']
```
## path.dirname(path)
@@ -135,7 +135,7 @@ the Unix `dirname` command. Trailing directory separators are ignored, see
For example:
```js
-path.dirname('/foo/bar/baz/asdf/quux')
+path.dirname('/foo/bar/baz/asdf/quux');
// Returns: '/foo/bar/baz/asdf'
```
@@ -162,19 +162,19 @@ an empty string is returned.
For example:
```js
-path.extname('index.html')
+path.extname('index.html');
// Returns: '.html'
-path.extname('index.coffee.md')
+path.extname('index.coffee.md');
// Returns: '.md'
-path.extname('index.')
+path.extname('index.');
// Returns: '.'
-path.extname('index')
+path.extname('index');
// Returns: ''
-path.extname('.index')
+path.extname('.index');
// Returns: ''
```
@@ -259,22 +259,22 @@ If the given `path` is a zero-length string, `false` will be returned.
For example on POSIX:
```js
-path.isAbsolute('/foo/bar') // true
-path.isAbsolute('/baz/..') // true
-path.isAbsolute('qux/') // false
-path.isAbsolute('.') // false
+path.isAbsolute('/foo/bar'); // true
+path.isAbsolute('/baz/..'); // true
+path.isAbsolute('qux/'); // false
+path.isAbsolute('.'); // false
```
On Windows:
```js
-path.isAbsolute('//server') // true
-path.isAbsolute('\\\\server') // true
-path.isAbsolute('C:/foo/..') // true
-path.isAbsolute('C:\\foo\\..') // true
-path.isAbsolute('bar\\baz') // false
-path.isAbsolute('bar/baz') // false
-path.isAbsolute('.') // false
+path.isAbsolute('//server'); // true
+path.isAbsolute('\\\\server'); // true
+path.isAbsolute('C:/foo/..'); // true
+path.isAbsolute('C:\\foo\\..'); // true
+path.isAbsolute('bar\\baz'); // false
+path.isAbsolute('bar/baz'); // false
+path.isAbsolute('.'); // false
```
A [`TypeError`][] is thrown if `path` is not a string.
@@ -297,10 +297,10 @@ working directory.
For example:
```js
-path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')
+path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');
// Returns: '/foo/bar/baz/asdf'
-path.join('foo', {}, 'bar')
+path.join('foo', {}, 'bar');
// throws 'TypeError: Path must be a string. Received {}'
```
@@ -327,14 +327,14 @@ current working directory.
For example on POSIX:
```js
-path.normalize('/foo/bar//baz/asdf/quux/..')
+path.normalize('/foo/bar//baz/asdf/quux/..');
// Returns: '/foo/bar/baz/asdf'
```
On Windows:
```js
-path.normalize('C:\\temp\\\\foo\\bar\\..\\')
+path.normalize('C:\\temp\\\\foo\\bar\\..\\');
// Returns: 'C:\\temp\\foo\\'
```
@@ -363,7 +363,7 @@ The returned object will have the following properties:
For example on POSIX:
```js
-path.parse('/home/user/dir/file.txt')
+path.parse('/home/user/dir/file.txt');
// Returns:
// { root: '/',
// dir: '/home/user/dir',
@@ -385,7 +385,7 @@ path.parse('/home/user/dir/file.txt')
On Windows:
```js
-path.parse('C:\\path\\dir\\file.txt')
+path.parse('C:\\path\\dir\\file.txt');
// Returns:
// { root: 'C:\\',
// dir: 'C:\\path\\dir',
@@ -440,14 +440,14 @@ directory will be used instead of the zero-length strings.
For example on POSIX:
```js
-path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')
+path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb');
// Returns: '../../impl/bbb'
```
On Windows:
```js
-path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb')
+path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb');
// Returns: '..\\..\\impl\\bbb'
```
@@ -483,13 +483,13 @@ of the current working directory.
For example:
```js
-path.resolve('/foo/bar', './baz')
+path.resolve('/foo/bar', './baz');
// Returns: '/foo/bar/baz'
-path.resolve('/foo/bar', '/tmp/file/')
+path.resolve('/foo/bar', '/tmp/file/');
// Returns: '/tmp/file'
-path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
+path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif');
// if the current working directory is /home/myself/node,
// this returns '/home/myself/node/wwwroot/static_files/gif/image.gif'
```
@@ -511,14 +511,14 @@ Provides the platform-specific path segment separator:
For example on POSIX:
```js
-'foo/bar/baz'.split(path.sep)
+'foo/bar/baz'.split(path.sep);
// Returns: ['foo', 'bar', 'baz']
```
On Windows:
```js
-'foo\\bar\\baz'.split(path.sep)
+'foo\\bar\\baz'.split(path.sep);
// Returns: ['foo', 'bar', 'baz']
```