Skip to content

Commit 771be2f

Browse files
doc: doc-deprecate fs.Stats public constructor
1 parent fc0f2cf commit 771be2f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/api/deprecations.md

Lines changed: 14 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6902,6 +6902,9 @@ i.e. before the `'ready'` event is emitted.
69026902
<!-- YAML
69036903
added: v0.1.21
69046904
changes:
6905+
- version: REPLACEME
6906+
pr-url: https://github.com/nodejs/node/pull/51879
6907+
description: Documentation deprecated public constructor.
69056908
- version: v8.1.0
69066909
pr-url: https://github.com/nodejs/node/pull/13173
69076910
description: Added times as numbers.
@@ -6914,6 +6917,7 @@ their synchronous counterparts are of this type.
69146917
If `bigint` in the `options` passed to those methods is true, the numeric values
69156918
will be `bigint` instead of `number`, and the object will contain additional
69166919
nanosecond-precision properties suffixed with `Ns`.
6920+
`Stat` objects are not to be created directly using the `new` keyword.
69176921
69186922
```console
69196923
Stats {

0 commit comments

Comments
 (0)