Skip to content

Commit 5e78a20

Browse files
committedMay 2, 2024
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 b3a11b5 commit 5e78a20

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
@@ -3478,6 +3478,20 @@ Calling `Hash` class directly with `Hash()` or `new Hash()` is
34783478
deprecated due to being internals, not intended for public use.
34793479
Please use the [`crypto.createHash()`][] method to create Hash instances.
34803480

3481+
### DEP0180: `fs.Stats` constructor
3482+
3483+
<!-- YAML
3484+
changes:
3485+
- version: REPLACEME
3486+
pr-url: https://github.com/nodejs/node/pull/51879
3487+
description: Documentation-only deprecation.
3488+
-->
3489+
3490+
Type: Documentation-only
3491+
3492+
Calling `fs.Stats` class directly with `Stats()` or `new Stats()` is
3493+
deprecated due to being internals, not intended for public use.
3494+
34813495
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
34823496
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
34833497
[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
@@ -6842,6 +6842,9 @@ i.e. before the `'ready'` event is emitted.
68426842
<!-- YAML
68436843
added: v0.1.21
68446844
changes:
6845+
- version: REPLACEME
6846+
pr-url: https://github.com/nodejs/node/pull/51879
6847+
description: Public constructor is deprecated.
68456848
- version: v8.1.0
68466849
pr-url: https://github.com/nodejs/node/pull/13173
68476850
description: Added times as numbers.
@@ -6854,6 +6857,7 @@ their synchronous counterparts are of this type.
68546857
If `bigint` in the `options` passed to those methods is true, the numeric values
68556858
will be `bigint` instead of `number`, and the object will contain additional
68566859
nanosecond-precision properties suffixed with `Ns`.
6860+
`Stat` objects are not to be created directly using the `new` keyword.
68576861
68586862
```console
68596863
Stats {

0 commit comments

Comments
 (0)
Please sign in to comment.