Skip to content

Commit a0c4668

Browse files
doc: deprecate fs.Stats public constructor
PR-URL: #51879 Refs: #51681 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
1 parent 7f0b805 commit a0c4668

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/api/deprecations.md

+14
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,20 @@ Calling `Hash` class directly with `Hash()` or `new Hash()` is
35743574
deprecated due to being internals, not intended for public use.
35753575
Please use the [`crypto.createHash()`][] method to create Hash instances.
35763576

3577+
### DEP0180: `fs.Stats` constructor
3578+
3579+
<!-- YAML
3580+
changes:
3581+
- version: REPLACEME
3582+
pr-url: https://github.com/nodejs/node/pull/51879
3583+
description: Documentation-only deprecation.
3584+
-->
3585+
3586+
Type: Documentation-only
3587+
3588+
Calling `fs.Stats` class directly with `Stats()` or `new Stats()` is
3589+
deprecated due to being internals, not intended for public use.
3590+
35773591
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
35783592
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
35793593
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4

doc/api/fs.md

+4
Original file line numberDiff line numberDiff line change
@@ -6999,6 +6999,9 @@ i.e. before the `'ready'` event is emitted.
69996999
<!-- YAML
70007000
added: v0.1.21
70017001
changes:
7002+
- version: REPLACEME
7003+
pr-url: https://github.com/nodejs/node/pull/51879
7004+
description: Public constructor is deprecated.
70027005
- version: v8.1.0
70037006
pr-url: https://github.com/nodejs/node/pull/13173
70047007
description: Added times as numbers.
@@ -7011,6 +7014,7 @@ their synchronous counterparts are of this type.
70117014
If `bigint` in the `options` passed to those methods is true, the numeric values
70127015
will be `bigint` instead of `number`, and the object will contain additional
70137016
nanosecond-precision properties suffixed with `Ns`.
7017+
`Stat` objects are not to be created directly using the `new` keyword.
70147018
70157019
```console
70167020
Stats {

0 commit comments

Comments
 (0)