0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

130 Commits

Author SHA1 Message Date
Vse Mozhet Byt
bff5d5b8f0 tools: add FileHandle to doc/type-parser.js
PR-URL: https://github.com/nodejs/node/pull/18601
Refs: https://github.com/nodejs/node/pull/18407
Refs: https://github.com/nodejs/node/pull/18444
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-07 00:27:43 +02:00
Vse Mozhet Byt
ac829f0135 doc: add missing URL types in fs promise API
This seems to be slipped in https://github.com/nodejs/node/pull/18297

PR-URL: https://github.com/nodejs/node/pull/18599
Refs: https://github.com/nodejs/node/pull/18309
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2018-02-06 17:31:48 +02:00
James M Snell
329fc78e49 fs: add initial set of fs.promises APIs
Initial set of fs.promises APIs with documentation and one
benchmark.

PR-URL: https://github.com/nodejs/node/pull/18297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-02-05 20:31:04 -08:00
Jamie Davis
67a4ce1c6e
fs: partition readFile against pool exhaustion
Problem:

Node implements fs.readFile as:
- a call to stat, then
- a C++ -> libuv request to read the entire file using the stat size

Why is this bad?
The effect is to place on the libuv threadpool a potentially-large
read request, occupying the libuv thread until it completes.
While readFile certainly requires buffering the entire file contents,
it can partition the read into smaller buffers
(as is done on other read paths)
along the way to avoid threadpool exhaustion.

If the file is relatively large or stored on a slow medium, reading
the entire file in one shot seems particularly harmful,
and presents a possible DoS vector.

Solution:

Partition the read into multiple smaller requests.

Considerations:

1. Correctness

I don't think partitioning the read like this raises
any additional risk of read-write races on the FS.
If the application is concurrently readFile'ing and modifying the file,
it will already see funny behavior. Though libuv uses preadv where
available, this doesn't guarantee read atomicity in the presence of
concurrent writes.

2. Performance

Downside: Partitioning means that a single large readFile will
  require into many "out and back" requests to libuv,
  introducing overhead.
Upside: In between each "out and back", other work pending on the
  threadpool can take a turn.

In short, although partitioning will slow down a large request,
it will lead to better throughput if the threadpool is handling
more than one type of request.

Fixes: https://github.com/nodejs/node/issues/17047

PR-URL: https://github.com/nodejs/node/pull/17054
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-01 11:11:48 +01:00
Vse Mozhet Byt
fd3a0cfb7c doc: linkify missing types
Also, alphabetize all types in type-parser.js
and fix some nits in type formats.

PR-URL: https://github.com/nodejs/node/pull/18444
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-01 02:52:31 +02:00
Michaël Zasso
312414662b url: expose the WHATWG URL API globally
Install URL and URLSearchParams on the global object, like they can be
found in browser environments.

PR-URL: https://github.com/nodejs/node/pull/18281
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-31 16:00:51 +01:00
Vse Mozhet Byt
914538803d doc: add missing URL argument types in fs.md
PR-URL: https://github.com/nodejs/node/pull/18309
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-01-23 20:13:45 +02:00
Vse Mozhet Byt
9870b53810 doc: remove confusing signature in fs.md
PR-URL: https://github.com/nodejs/node/pull/18310
Fixes: https://github.com/nodejs/node/issues/18305
Refs: https://github.com/nodejs/node/pull/13424
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-23 12:48:59 +02:00
Vse Mozhet Byt
d955645e4b doc: decapitalize primitive types
PR-URL: https://github.com/nodejs/node/pull/18110
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-01-12 02:47:22 +02:00
Mykola Bilochub
bcb01de515 doc: fix incorrect argument type in fs.readSync
The `buffer` argument must be either Buffer or Uint8Array, string
values are not supported.

PR-URL: https://github.com/nodejs/node/pull/18022
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-09 15:26:32 -08:00
James M Snell
286a5d0e74 doc: fs doc improvements
PR-URL: https://github.com/nodejs/node/pull/17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-28 08:50:29 -08:00
Evan Lucas
35511c8ba1 doc: improve fs api descriptions
This improves the api descriptions for fs.chown, fs.chmod, and fs.mkdir
along with their *Sync counterparts.

PR-URL: https://github.com/nodejs/node/pull/17679
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-21 09:42:13 -05:00
Jon Moss
ef8acccfde doc: remove unused link definition
Causing the linter job to fail on CI right now.

PR-URL: https://github.com/nodejs/node/pull/17741
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-12-18 16:58:21 -05:00
James M Snell
400e73a9d0 doc: some fs doc improvements
PR-URL: https://github.com/nodejs/node/pull/17692
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-12-18 11:31:36 -08:00
Jeremiah Senkpiel
934490b3f6 doc: fix fs.existsSync description
Also works on directories.

PR-URL: https://github.com/nodejs/node/pull/17702
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-12-18 10:26:05 -05:00
Rich Trott
25385ef26a doc: immprove inode text in fs.md
Rewrite and edit somewhat confusing paragraph about inodes and AIX in
fs.md.

PR-URL: https://github.com/nodejs/node/pull/17519
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-08 11:30:11 -08:00
Rich Trott
21b3b0967f doc: standardize preposition usage in fs.md
"On <operating system>" is used everywhere in this file except for one
use of "In <operating system>". Standardize to "On".

PR-URL: https://github.com/nodejs/node/pull/17463
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-05 19:47:00 -08:00
Rich Trott
38190d0c8a doc: improve punctuation in fs.open() text
PR-URL: https://github.com/nodejs/node/pull/17463
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-05 19:46:55 -08:00
Rich Trott
ff9a6bc1f3 doc: add missing serial commas
PR-URL: https://github.com/nodejs/node/pull/17384
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-12-01 14:46:36 -08:00
Jamie Davis
a59ad82a06 doc: fs.readFile is async but not partitioned
This change was suggested during the discussion of #17054.

PR-URL: https://github.com/nodejs/node/pull/17154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-11-22 11:10:23 -08:00
Sebastian Silbermann
2c0acc0bc1
doc: explicitly document highWaterMark option
PR-URL: https://github.com/nodejs/node/pull/17049
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:26:39 +01:00
Gaara
667f8c642d
doc: correct the wrong added meta data
PR-URL: https://github.com/nodejs/node/pull/17072
Fixes: https://github.com/nodejs/node/issues/17026
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2017-11-16 15:30:33 -05:00
Ben Noordhuis
cb137eb159 doc: document fs.realpath.native()
Mea culpa, somehow I managed to drop the documentation commit while
merging the pull request.  This should have been included in commit
74023c072c ("fs: expose realpath(3) bindings") from this month.

PR-URL: https://github.com/nodejs/node/pull/17059
Refs: https://github.com/nodejs/node/pull/15776
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-16 16:27:04 +01:00
James M Snell
8cd940af13 2017-10-31, Version 9.0.0 (Current)
* Older experimental APIs have been removed.
    [[`d731369b1d`](https://github.com/nodejs/node/commit/d731369b1d)]
    [#14414](https://github.com/nodejs/node/pull/14414)

* **Errors**
  * Improvements have been made to `buffer` module error messages.
  * The assignment of static error codes to Node.js error continues:
    * `buffer`
    * `child_process`
    * `console`
    * `crypto`
    * `dns`
    * `events`
    * `fs`
    * `http`
    * `inspector`
    * `net`
    * `path`
    * `process`
    * `querystring`
    * `readline`
    * `repl`
    * `streams`
    * `string_decoder`
    * `timers`
    * `tls`
    * `url`
    * `util`
    * `v8`
    * `zlib`

* **Child Processes**
  * Errors are emitted on process nextTick.

* **Domains**
  * The long-deprecated `.dispose()` method has been removed.

* **fs**
  * The `fs.ReadStream` and `fs.WriteStream` classes now use `destroy()`.
  * `fs` module callbacks are now invoked with an undefined context.

* **HTTP/1**
  * A 400 Bad Request response will now be sent when parsing fails.
  * Socket timeout will be set when the socket connects.
  * A bug causing the request `'error'` event to fire twice was fixed.
  * HTTP clients may now use generic `Duplex` streams in addition to `net.Socket`.

* **Intl**
  * The deprecated `Intl.v8BreakIterator` has been removed.

* **Modules**
  * The `require.resolve()` method now supports using custom lookup paths.

* **OS**
  * The `os.EOL` property is now read-only.

* **Timers**
  * `setTimeout()` will emit a warning if the timeout is larger that the maximum
    32-bit unsigned integer.
2017-10-31 12:59:12 -07:00
Vse Mozhet Byt
93d113510d doc: replace undocumented encoding aliases
PR-URL: https://github.com/nodejs/node/pull/16368
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-10-22 13:12:24 +03:00
Bartosz Sosnowski
4f1d54829b
doc: document opening hidden files on Windows
PR-URL: https://github.com/nodejs/node/pull/15409
Fixes: https://github.com/nodejs/node/issues/14553
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-19 03:23:40 -02:00
NiveditN
371d1db60c doc: added note to fs.watchFile on previousStat
Explains the expected behavior of previousStat in fs.watchFile() when
a watched file disappears and reappears.

PR-URL: https://github.com/nodejs/node/pull/16099
Fixes: https://github.com/nodejs/node/issues/15364
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-10-14 22:39:14 +08:00
r1cebank
c885ea727d lib: deprecate fd usage for fs.truncate(Sync)
PR-URL: https://github.com/nodejs/node/pull/15990
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-12 18:02:14 -07:00
James M. Greene
20f8a22259 doc: fix the description of 'close' event
PR-URL: https://github.com/nodejs/node/pull/15800
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-11 19:05:43 +08:00
Luigi Pinca
0c49038f88 doc: fix YAML syntax in fs.md
Fixes YAML parsing issues introduced in c8a2143.

PR-URL: https://github.com/nodejs/node/pull/15769
Refs: https://github.com/nodejs/node/pull/15680
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-06 00:02:41 +03:00
Luigi Pinca
c8a21436c9
doc: update fs.utimes{,Sync} changelog
Specify that `NaN`, `Infinity`, and `-Infinity` are no longer valid
values for the `atime` and `mtime` arguments.

PR-URL: https://github.com/nodejs/node/pull/15680
Fixes: https://github.com/nodejs/node/issues/15453
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-02 01:19:18 -03:00
Refael Ackermann
64e97b2c26
doc: improve fs.utimes
PR-URL: https://github.com/nodejs/node/pull/14154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-28 02:16:22 -03:00
Matej Krajčovič
a636b72645
doc: add callback function signatures in fs.md
PR-URL: https://github.com/nodejs/node/pull/13424
Refs: https://github.com/nodejs/node/issues/11135
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-28 02:14:13 -03:00
Tobias Nießen
f98687db4a
doc,test: minor improvements to O_DSYNC
PR-URL: https://github.com/nodejs/node/pull/15547
Refs: https://github.com/nodejs/node/pull/15451
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-26 16:19:15 +02:00
Jussi Räsänen
60460bf80d
fs: add O_DSYNC
PR-URL: https://github.com/nodejs/node/pull/15451
Fixes: https://github.com/nodejs/node/issues/15425
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-22 02:47:45 +02:00
Bartosz Sosnowski
1ebde6e113
doc: make mkdtemp example work on Windows
PR-URL: https://github.com/nodejs/node/pull/15408
Fixes: https://github.com/nodejs/node/issues/14960
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-09-19 16:32:41 -03:00
Myles Borins
a10856a7d3
2017-09-12, Version 8.5.0 (Current)
Notable Changes

* build:
  * Snapshots are now re-enabled in V8
  https://github.com/nodejs/node/pull/14875

* console:
  * Implement minimal `console.group()`.
  https://github.com/nodejs/node/pull/14910

* deps:
  * upgrade libuv to 1.14.1
    https://github.com/nodejs/node/pull/14866
  * update nghttp2 to v1.25.0
    https://github.com/nodejs/node/pull/14955

* dns:
  * Add `verbatim` option to dns.lookup(). When true, results from the
    DNS resolver are passed on as-is, without the reshuffling that
    Node.js otherwise does that puts IPv4 addresses before IPv6
    addresses.
    https://github.com/nodejs/node/pull/14731

* fs:
  * add fs.copyFile and fs.copyFileSync which allows for more efficient
    copying of files.
    https://github.com/nodejs/node/pull/15034

* inspector:
  * Enable async stack traces
    https://github.com/nodejs/node/pull/13870

* module:
  * Add support for ESM. This is currently behind the
    `--experimental-modules` flag and requires the .mjs extension.
    `node --experimental-modules index.mjs`
    https://github.com/nodejs/node/pull/14369

* napi:
  * implement promise
    https://github.com/nodejs/node/pull/14365

* os:
  * Add support for CIDR notation to the output of the
    networkInterfaces() method.
    https://github.com/nodejs/node/pull/14307

* perf_hooks:
  * An initial implementation of the Performance Timing API for
    Node.js. This is the same Performance Timing API implemented by
    modern browsers with a number of Node.js specific properties. The
    User Timing mark() and measure() APIs are implemented, as is a
    Node.js specific flavor of the Frame Timing for measuring event
    loop duration.
    https://github.com/nodejs/node/pull/14680

* tls:
  * multiple PFX in createSecureContext
    [#14793](https://github.com/nodejs/node/pull/14793)

* Added new collaborators:
  * BridgeAR – Ruben Bridgewater

PR-URL: https://github.com/nodejs/node/pull/15308
2017-09-12 17:34:51 +02:00
cjihrig
11b7428832
fs: add fs.copyFile{Sync}
Fixes: https://github.com/nodejs/node/issues/14906
PR-URL: https://github.com/nodejs/node/pull/15034
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-08 00:08:04 -04:00
Chris Young
cacce304cb doc: add links to alternative versions of doc
Each page of the API documentation should have links to other versions
of the same page. This will make it easier to switch between the current
"live" release at nodejs.org and LTS versions.

PR-URL: https://github.com/nodejs/node/pull/10958
Fixes: https://github.com/nodejs/node/issues/10726
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-08-28 11:17:08 +02:00
Sam Roberts
a1d34b3f49 doc: threadpool size, and APIs using the pool
Not knowing which APIs use libuv's threadpool can lead to surprising
performance problems. Document the APIs, and also document
UV_THREADPOOL_SIZE, which can be used to fix problems.

PR-URL: https://github.com/nodejs/node/pull/14995
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-25 10:16:00 -07:00
Aleh Zasypkin
e96c11c384
doc,fs: rename defaultEncoding option to encoding
The documentation for `fs.createWriteStream()` references a
`defaultEncoding` as possible options property, but in reality
`encoding` property is expected and properly handled. This fix updates
the documentation to rename the `defaultEncoding` property to
`encoding`.

PR-URL: https://github.com/nodejs/node/pull/14867
Fixes: https://github.com/nodejs/node/issues/14611
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 18:03:51 -04:00
Rich Trott
0f325aaaeb doc: improve fs.read() doc text
PR-URL: https://github.com/nodejs/node/pull/14631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-07 15:05:03 -07:00
dcharbonnier
680285c3b4 doc: clarify the position argument for fs.read
What happen to the file position after a read using a position null or
integer was not clear and you can assume that the cursor of the file
descriptor is updated even if position is an integer.

PR-URL: https://github.com/nodejs/node/pull/14631
Fixes: https://github.com/https://github.com/nodejs/node/issues/8397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-07 15:04:55 -07:00
Oleksandr Kushchak
bd7735e8f7 docs: add note about fs.rmdir()
fs.rmdir() on the file (not directory) results in different errors on
Windows to everything else

Fixes: https://github.com/nodejs/node/issues/8797
PR-URL: https://github.com/nodejs/node/pull/14323
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-07-19 13:46:33 -07:00
XadillaX
a2d3cec81c
doc,test: fs - reserved characters under win32
Explain the behavior of `fs.open()` under win32 that file path contains
some characters and add some test cases for them.

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

PR-URL: https://github.com/nodejs/node/pull/13875
Refs: https://github.com/nodejs/node/issues/13868
Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540537.aspx
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-07-09 12:32:40 -04:00
Matej Krajčovič
51bb4ace5f doc: add default values to functions in fs.md
PR-URL: https://github.com/nodejs/node/pull/13767
Refs: https://github.com/nodejs/node/issues/11135
Refs: https://github.com/nodejs/node/pull/13769
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-03 00:15:30 +02:00
Rich Trott
8969c1b762 doc: fix indentation issues in sample code
In preparation for stricter ESLint indentation checking, fix a few
issues in sample code.

PR-URL: https://github.com/nodejs/node/pull/13950
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-29 15:43:56 -07:00
Gibson Fahnestock
4eeb4a4408 doc: note that fs.futimes only works on AIX >7.1
PR-URL: https://github.com/nodejs/node/pull/13659
Fixes: https://github.com/nodejs/node/issues/12609
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> i
2017-06-28 20:14:46 -07:00
Daijiro Wachi
4ca3b9cd6a doc: fix api docs style
doc/api/async_hooks.md
  + L198: Missing code-language flag
  + L239: Missing code-language flag
  + L317: Missing code-language flag
  + L347: Missing code-language flag

doc/api/fs.md
  + L2857: Unused definition

PR-URL: https://github.com/nodejs/node/pull/13700
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-06-19 10:51:37 +02:00
Vse Mozhet Byt
e2617a0388 doc: fix links and typos in fs.md
PR-URL: https://github.com/nodejs/node/pull/13573
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-06-12 12:23:35 +03:00