Skip to content

Do not depend on deprecated 'constants' module - #206

Open
kt3k wants to merge 3 commits into
isaacs:mainfrom
kt3k:fix/do-not-depend-on-deprecated-constants
Open

kt3k wants to merge 3 commits into
isaacs:mainfrom
kt3k:fix/do-not-depend-on-deprecated-constants

Conversation

@kt3k

@kt3k kt3k commented Feb 21, 2021

Copy link
Copy Markdown

constants module has been deprecated since v6.3.0 (ref: https://nodejs.org/api/deprecations.html#DEP0008 ). This PR updates the use of constants to fs.constants.

BTW fs.constants doesn't inherit from Object.prototype (ref: nodejs/node#10458 ), so I updated constants.hasOwnProperty('O_SYMLINK') to constants.O_SYMLINK !== undefined. (This change was discussed in node.js repository nodejs/node#10458 (comment) )

@kt3k
kt3k force-pushed the fix/do-not-depend-on-deprecated-constants branch from 9f7b7c4 to 45e62bd Compare February 21, 2021 13:01
Comment thread polyfills.js Outdated
Co-authored-by: Corey Farrell <git@cfware.com>

@aminya aminya left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a lot of issues for me. @isaacs Please take a look

@aminya

aminya commented Jul 23, 2021

Copy link
Copy Markdown

fs-extra is broken and cannot be bundled because of this.

@anthonyborell

Copy link
Copy Markdown

@isaacs Would be great if you could take a look at this. As per https://nodejs.org/api/deprecations.html#DEP0008

The constants module is deprecated. When requiring access to constants relevant to specific Node.js builtin modules, developers should instead refer to the constants property exposed by the relevant module. For instance, require('fs').constants and require('os').constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants