Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: some fixes in repl.md #10160

Closed
wants to merge 85 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
9615910
doc: var => let / const in repl.md
vsemozhetbyt Dec 6, 2016
3e18789
doc: white space unification in repl.md
vsemozhetbyt Dec 6, 2016
743f84d
doc: fix an output example in repl.md
vsemozhetbyt Dec 6, 2016
a7501f2
doc: fix a function name in repl.md
vsemozhetbyt Dec 6, 2016
402c625
doc: name anonymous functions in repl.md
vsemozhetbyt Dec 6, 2016
e20c785
doc: document argument variant in repl.md
vsemozhetbyt Dec 6, 2016
4357059
doc: add the valid link for curl(1) in repl.md
vsemozhetbyt Dec 6, 2016
9c7054b
doc: replace anonymous functions in repl.md
vsemozhetbyt Dec 7, 2016
cdeb85e
test: move long-running test to sequential
Trott Dec 7, 2016
da077ee
test: refactor test-dgram-bind-default-address
mbchoa Dec 1, 2016
22e2c47
build: fix node_g target
danbev Dec 6, 2016
a244147
test: check result of uv_loop_init and uv_write
bnoordhuis Dec 5, 2016
1b25214
test: use const and strictEqual in test-os-homedir-no-envvar
codeVana Dec 1, 2016
61d6293
url: improve URLSearchParams spec compliance
TimothyGu Nov 6, 2016
ac78812
test: refactor test-domain-exit-dispose-again
Ethan-Arrowood Dec 1, 2016
b0c10a2
test: refactor test-domain-from-timer
Dec 1, 2016
586b787
doc: removing extra space in README
italoacasas Dec 7, 2016
df4018e
doc: reword variable declaration note in repl.md
vsemozhetbyt Dec 7, 2016
29b2e88
test: improve test-fs-read-stream.js
jennabelle Nov 16, 2016
c6eae5a
doc: adding missing - in README
italoacasas Dec 7, 2016
8960383
test: refactor test-beforeexit-event
radelmann Dec 4, 2016
83d9cd8
test: refactor test-https-agent-session-reuse
dpaez Dec 3, 2016
fd6999e
test: improves test-tls-client-verify
Dec 1, 2016
57f993d
test: renamed assert.Equal to assert.strictEqual
triscuitoraus Dec 1, 2016
e6a0c39
test: changed assert.equal to assert.strictEqual
zina-olson Dec 1, 2016
558fa1c
test: change assert.equal to assert.strictEqual
Dec 1, 2016
deb9cc0
test: use `assert.strictEqual`
anoff Dec 1, 2016
68488e9
test: fix error in test-cluster-worker-death.js
Dec 1, 2016
1e4b9a1
test: refactor test-crypto-hmac
eudaimos Dec 1, 2016
2d0ce51
doc: update `path.format` description and examples
anoff Dec 1, 2016
6967ed4
test: refactor test-net-keepalive.js
kmccmk9 Dec 1, 2016
df39784
http: verify client method is a string
lucamaraschi Dec 4, 2016
a0a6ff2
doc: add some info on `tty#setRawMode()`
Fishrock123 Dec 6, 2016
6dd0754
test: fix flaky test-net-socket-timeout
Trott Dec 7, 2016
9a5d475
http: remove stale timeout listeners
Nov 1, 2016
f0da38a
test: increase test coverage of BufferList
joyeecheung Dec 1, 2016
444b907
test: refactor test-http-unix-socket
Dec 1, 2016
6aacef7
test: check for error on invalid signal
mattcphillips Dec 1, 2016
a8137dd
tools: add macosx-firwall script to avoid popups
danbev Dec 3, 2016
def6dfb
test: set stdin too for pseudo-tty tests
addaleax Dec 6, 2016
b8fc9a3
test: add stdin-setrawmode.out file
Dec 6, 2016
bc335c0
doc: buffer allocation throws for negative size
joyeecheung Dec 6, 2016
f9aadfb
inspector: move options parsing
Nov 18, 2016
d8c7534
inspector: stop relying on magic strings
Nov 21, 2016
3d24856
doc: revert documenting argument form in repl.md
vsemozhetbyt Dec 9, 2016
cffbb32
doc: add note to parallelize make
Dec 1, 2016
0cd1f54
doc: standardizing on make -j4
Dec 6, 2016
4d11c2c
lib,test: use consistent operator linebreak style
targos Dec 8, 2016
7c2dbd1
tools: enforce consistent operator linebreak style
targos Dec 8, 2016
aa77b76
lib,src: support values > 4GB in heap statistics
bnoordhuis Dec 8, 2016
8dbf1af
test: stream readableListening internal state
italoacasas Dec 1, 2016
8621ccc
test: stream readableState readingMore state
chmln Dec 1, 2016
f5c2c8c
test: improving crypto fips
Dec 1, 2016
9f58e02
test: improve buffer transcode
Dec 1, 2016
a84017a
url, test: including base argument in originFor
joyeecheung Dec 1, 2016
5607228
test: use ES6 in test-debugger-client.js
edsadr Dec 8, 2016
14b0b44
doc: fix typo in code example of 'path' module
pallxk Dec 6, 2016
10929f6
test: fail for missing output files
addaleax Dec 6, 2016
f418a22
doc: modernize child_process example code
vsemozhetbyt Dec 3, 2016
9ee915b
buffer: handle UCS2 `.fill()` properly on BE
addaleax Dec 6, 2016
d4f00fe
buffer: fix single-character string filling
addaleax Nov 29, 2016
c3839f7
tls: fix/annotate connect arg comments
sam-github Nov 18, 2016
d4050b3
tls: document and test option-less createServer
sam-github Nov 21, 2016
475b8db
test: tls key/cert ordering not necessary
sam-github Nov 22, 2016
a28e949
tls: do not refer to secureOptions as flags
sam-github Nov 22, 2016
caa7fa9
doc: rework tls for accuracy and clarity
sam-github Nov 23, 2016
db50307
test: var to const in tls-no-cert-required
sam-github Dec 9, 2016
fa4f158
test: replace var with const in test-require-dot
amarzavery Dec 1, 2016
a8e8708
test: add ES6 and strictEqual to test-fs-truncate
edsadr Dec 7, 2016
499fc7a
test: refactor test-handle-wrap-close-abort
Trott Dec 9, 2016
50cb3a3
doc: document argument variant in the repl.md
vsemozhetbyt Dec 10, 2016
7346e55
test: refactor http pipelined socket test
Trott Dec 9, 2016
10891a1
test: refactor assert.equal, update syntax to ES6
Dec 1, 2016
8bad37a
test: refactor test-https-truncate
Trott Dec 11, 2016
5f18b40
doc: var => let / const in repl.md
vsemozhetbyt Dec 6, 2016
bed9aae
doc: white space unification in repl.md
vsemozhetbyt Dec 6, 2016
9bef034
doc: fix an output example in repl.md
vsemozhetbyt Dec 6, 2016
67c2a7d
doc: fix a function name in repl.md
vsemozhetbyt Dec 6, 2016
d665e39
doc: name anonymous functions in repl.md
vsemozhetbyt Dec 6, 2016
5f31da7
doc: document argument variant in repl.md
vsemozhetbyt Dec 6, 2016
d5861ad
doc: add the valid link for curl(1) in repl.md
vsemozhetbyt Dec 6, 2016
0c32eb5
doc: replace anonymous functions in repl.md
vsemozhetbyt Dec 7, 2016
936263e
doc: reword variable declaration note in repl.md
vsemozhetbyt Dec 7, 2016
588a5d5
doc: revert documenting argument form in repl.md
vsemozhetbyt Dec 9, 2016
10c0137
doc: resolved merge conflict
vsemozhetbyt Dec 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ rules:
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]
no-tabs: 2
no-trailing-spaces: 2
operator-linebreak: [2, after, {overrides: {'?': ignore, ':': ignore}}]
quotes: [2, single, avoid-escape]
semi: 2
semi-spacing: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md
##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes
- [ ] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message follows commit guidelines
Expand Down
19 changes: 18 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,33 @@ On OS X, you will also need:
this under the menu `Xcode -> Preferences -> Downloads`
* This step will install `gcc` and the related toolchain containing `make`

* You may want to setup [firewall rules](tools/macosx-firewall.sh) to avoid
popups asking to accept incoming network connections when running tests:

```console
$ sudo ./tools/macosx-firewall.sh
```
Running this script will add rules for the executable `node` in the out
directory and the symbolic `node` link in the projects root directory.

On FreeBSD and OpenBSD, you may also need:
* libexecinfo

To build Node.js:

```console
$ ./configure
$ make
$ make -j4
```

Running `make` with the `-j4` flag will cause it to run 4 compilation jobs
concurrently which may significantly reduce build time. The number after `-j`
can be changed to best suit the number of processor cores on your machine. If
you run into problems running `make` with concurrency, try running it without
the `-j4` flag. See the
[GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html)
for more information.

Note that the above requires that `python` resolve to Python 2.6 or 2.7 and not a newer version.

To run the tests:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ to see how they should be structured can also help.
To run the tests on Unix / OS X:

```text
$ ./configure && make -j8 test
$ ./configure && make -j4 test
```

Windows:
Expand Down Expand Up @@ -189,7 +189,7 @@ You can run tests directly with node:
$ ./node ./test/parallel/test-stream2-transform.js
```

Remember to recompile with `make -j8` in between test runs if you change
Remember to recompile with `make -j4` in between test runs if you change
core modules.

### Step 6: Push
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ endif
# See comments on the build-addons target for some more info
$(NODE_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Release V=$(V)
if [ ! -r $(NODE_EXE) -o ! -L $(NODE_EXE) ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi

$(NODE_G_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
if [ ! -r $(NODE_EXE) -o ! -L $(node_EXE) ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi

out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ more information about the governance of the Node.js project, see
**Ilkka Myller** &lt;ilkka.myller@nodefield.com&gt;
* [isaacs](https://github.com/isaacs) -
**Isaac Z. Schlueter** &lt;i@izs.me&gt;
* [italoacasas](https://github.com/italoacasas)
**Italo A. Casas** &lt;me@italoacasas.com&gt;
* [italoacasas](https://github.com/italoacasas) -
**Italo A. Casas** &lt;me@italoacasas.com&gt;
* [iWuzHere](https://github.com/iWuzHere) -
**Imran Iqbal** &lt;imran@imraniqbal.org&gt;
* [JacksonTian](https://github.com/JacksonTian) -
Expand Down
31 changes: 15 additions & 16 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ deprecated: v6.0.0

* `size` {Integer} The desired length of the new `Buffer`

Allocates a new `Buffer` of `size` bytes. The `size` must be less than or equal
to the value of [`buffer.kMaxLength`]. Otherwise, a [`RangeError`] is thrown.
A zero-length `Buffer` will be created if `size <= 0`.
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
A zero-length `Buffer` will be created if `size` is 0.

Unlike [`ArrayBuffers`][`ArrayBuffer`], the underlying memory for `Buffer` instances
created in this way is *not initialized*. The contents of a newly created `Buffer`
Expand Down Expand Up @@ -470,9 +470,9 @@ const buf = Buffer.alloc(5);
console.log(buf);
```

The `size` must be less than or equal to the value of [`buffer.kMaxLength`].
Otherwise, a [`RangeError`] is thrown. A zero-length `Buffer` will be created if
`size <= 0`.
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
A zero-length `Buffer` will be created if `size` is 0.

If `fill` is specified, the allocated `Buffer` will be initialized by calling
[`buf.fill(fill)`][`buf.fill()`].
Expand Down Expand Up @@ -511,9 +511,9 @@ added: v5.10.0

* `size` {Integer} The desired length of the new `Buffer`

Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
be less than or equal to the value of [`buffer.kMaxLength`]. Otherwise, a
[`RangeError`] is thrown. A zero-length `Buffer` will be created if `size <= 0`.
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
A zero-length `Buffer` will be created if `size` is 0.

The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
Expand Down Expand Up @@ -557,10 +557,9 @@ added: v5.10.0

* `size` {Integer} The desired length of the new `Buffer`

Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
`size` must be less than or equal to the value of [`buffer.kMaxLength`].
Otherwise, a [`RangeError`] is thrown. A zero-length `Buffer` will be created if
`size <= 0`.
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
A zero-length `Buffer` will be created if `size` is 0.

The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
Expand Down Expand Up @@ -2390,9 +2389,9 @@ deprecated: v6.0.0

* `size` {Integer} The desired length of the new `SlowBuffer`

Allocates a new `SlowBuffer` of `size` bytes. The `size` must be less than
or equal to the value of [`buffer.kMaxLength`]. Otherwise, a [`RangeError`] is
thrown. A zero-length `Buffer` will be created if `size <= 0`.
Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
A zero-length `Buffer` will be created if `size` is 0.

The underlying memory for `SlowBuffer` instances is *not initialized*. The
contents of a newly created `SlowBuffer` are unknown and could contain
Expand Down
34 changes: 17 additions & 17 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ const spawn = require('child_process').spawn;
const bat = spawn('cmd.exe', ['/c', 'my.bat']);

bat.stdout.on('data', (data) => {
console.log(data);
console.log(data.toString());
});

bat.stderr.on('data', (data) => {
console.log(data);
console.log(data.toString());
});

bat.on('exit', (code) => {
Expand All @@ -113,7 +113,7 @@ exec('my.bat', (err, stdout, stderr) => {
});

// Script with spaces in the filename:
const bat = spawn('"my script.cmd"', ['a', 'b'], { shell:true });
const bat = spawn('"my script.cmd"', ['a', 'b'], { shell: true });
// or:
exec('"my script.cmd" a b', (err, stdout, stderr) => {
// ...
Expand Down Expand Up @@ -383,7 +383,7 @@ ps.on('close', (code) => {
});

grep.stdout.on('data', (data) => {
console.log(`${data}`);
console.log(data.toString());
});

grep.stderr.on('data', (data) => {
Expand Down Expand Up @@ -467,8 +467,8 @@ const out = fs.openSync('./out.log', 'a');
const err = fs.openSync('./out.log', 'a');

const child = spawn('prg', [], {
detached: true,
stdio: [ 'ignore', out, err ]
detached: true,
stdio: [ 'ignore', out, err ]
});

child.unref();
Expand Down Expand Up @@ -860,7 +860,7 @@ as in this example:
'use strict';
const spawn = require('child_process').spawn;

let child = spawn('sh', ['-c',
const child = spawn('sh', ['-c',
`node -e "setInterval(() => {
console.log(process.pid, 'is alive')
}, 500);"`
Expand Down Expand Up @@ -1107,21 +1107,21 @@ const fs = require('fs');
const child_process = require('child_process');

const child = child_process.spawn('ls', {
stdio: [
0, // Use parents stdin for child
'pipe', // Pipe child's stdout to parent
fs.openSync('err.out', 'w') // Direct child's stderr to a file
]
stdio: [
0, // Use parent's stdin for child
'pipe', // Pipe child's stdout to parent
fs.openSync('err.out', 'w') // Direct child's stderr to a file
]
});

assert.equal(child.stdio[0], null);
assert.equal(child.stdio[0], child.stdin);
assert.strictEqual(child.stdio[0], null);
assert.strictEqual(child.stdio[0], child.stdin);

assert(child.stdout);
assert.equal(child.stdio[1], child.stdout);
assert.strictEqual(child.stdio[1], child.stdout);

assert.equal(child.stdio[2], null);
assert.equal(child.stdio[2], child.stderr);
assert.strictEqual(child.stdio[2], null);
assert.strictEqual(child.stdio[2], child.stderr);
```

### child.stdout
Expand Down
33 changes: 11 additions & 22 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1082,26 +1082,15 @@ deprecated: v0.11.13

> Stability: 0 - Deprecated: Use [`tls.createSecureContext()`][] instead.

The `crypto.createCredentials()` method is a deprecated alias for creating
and returning a `tls.SecureContext` object. The `crypto.createCredentials()`
method should not be used.
- `details` {Object} Identical to [`tls.createSecureContext()`][].

The optional `details` argument is a hash object with keys:
The `crypto.createCredentials()` method is a deprecated function for creating
and returning a `tls.SecureContext`. It should not be used. Replace it with
[`tls.createSecureContext()`][] which has the exact same arguments and return
value.

* `pfx` : {String|Buffer} - PFX or PKCS12 encoded private
key, certificate and CA certificates
* `key` : {String} - PEM encoded private key
* `passphrase` : {String} - passphrase for the private key or PFX
* `cert` : {String} - PEM encoded certificate
* `ca` : {String|Array} - Either a string or array of strings of PEM encoded CA
certificates to trust.
* `crl` : {String|Array} - Either a string or array of strings of PEM encoded CRLs
(Certificate Revocation List)
* `ciphers`: {String} using the [OpenSSL cipher list format][] describing the
cipher algorithms to use or exclude.

If no 'ca' details are given, Node.js will use Mozilla's default
[publicly trusted list of CAs][].
Returns a `tls.SecureContext`, as-if [`tls.createSecureContext()`][] had been
called.

### crypto.createDecipher(algorithm, password)
<!-- YAML
Expand Down Expand Up @@ -1653,8 +1642,8 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
</tr>
<tr>
<td><code>SSL_OP_CIPHER_SERVER_PREFERENCE</code></td>
<td>Uses the server's preferences instead of the clients when selecting a
cipher. See
<td>Attempts to use the server's preferences instead of the client's when
selecting a cipher. Behaviour depends on protocol version. See
https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html.</td>
</tr>
<tr>
Expand Down Expand Up @@ -1682,7 +1671,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
</tr>
<tr>
<td><code>SSL_OP_LEGACY_SERVER_CONNECT</code></td>
<td>Allow initial connection to servers that do not support RI.</td>
<td>Allows initial connection to servers that do not support RI.</td>
</tr>
<tr>
<td><code>SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER</code></td>
Expand Down Expand Up @@ -1980,4 +1969,4 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
[RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt
[stream]: stream.html
[stream-writable-write]: stream.html#stream_writable_write_chunk_encoding_callback
[Crypto Constants]: #crypto_crypto_constants
[Crypto Constants]: #crypto_crypto_constants_1
40 changes: 13 additions & 27 deletions doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ On POSIX:

```js
path.basename('C:\\temp\\myfile.html');
// Returns: 'C:\temp\myfile.html'
// Returns: 'C:\\temp\\myfile.html'
```

On Windows:
Expand Down Expand Up @@ -182,37 +182,32 @@ added: v0.11.15
The `path.format()` method returns a path string from an object. This is the
opposite of [`path.parse()`][].

The following process is used when constructing the path string:
When providing properties to the `pathObject` remember that there are
combinations where one property has priority over another:

* `output` is set to an empty string.
* If `pathObject.dir` is specified, `pathObject.dir` is appended to `output`
followed by the value of `path.sep`;
* Otherwise, if `pathObject.root` is specified, `pathObject.root` is appended
to `output`.
* If `pathObject.base` is specified, `pathObject.base` is appended to `output`;
* Otherwise:
* If `pathObject.name` is specified, `pathObject.name` is appended to `output`
* If `pathObject.ext` is specified, `pathObject.ext` is appended to `output`.
* Return `output`
* `pathObject.root` is ignored if `pathObject.dir` is provided
* `pathObject.ext` and `pathObject.name` are ignored if `pathObject.base` exists

For example, on POSIX:

```js
// If `dir` and `base` are provided,
// If `dir`, `root` and `base` are provided,
// `${dir}${path.sep}${base}`
// will be returned.
// will be returned. `root` is ignored.
path.format({
root: '/ignored',
dir: '/home/user/dir',
base: 'file.txt'
});
// Returns: '/home/user/dir/file.txt'

// `root` will be used if `dir` is not specified.
// If only `root` is provided or `dir` is equal to `root` then the
// platform separator will not be included.
// platform separator will not be included. `ext` will be ignored.
path.format({
root: '/',
base: 'file.txt'
base: 'file.txt',
ext: 'ignored'
});
// Returns: '/file.txt'

Expand All @@ -223,23 +218,14 @@ path.format({
ext: '.txt'
});
// Returns: '/file.txt'

// `base` will be returned if `dir` or `root` are not provided.
path.format({
base: 'file.txt'
});
// Returns: 'file.txt'
```

On Windows:

```js
path.format({
root : "C:\\",
dir : "C:\\path\\dir",
base : "file.txt",
ext : ".txt",
name : "file"
dir : "C:\\path\\dir",
base : "file.txt"
});
// Returns: 'C:\\path\\dir\\file.txt'
```
Expand Down
Loading