Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime(js): update constant imports to use node:fs module #1850

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

smorimoto
Copy link
Member

Summary

This PR addresses the deprecation warning DEP0008 by replacing direct usage of the deprecated node:constants module with the recommended approach of accessing constants through their respective modules.

Changes

  • Replaced require("node:constants") with require("node:fs").constants in runtime/js/fs_node.js
  • Updated code to follow Node.js best practices for accessing module-specific constants

Related Documentation

Signed-off-by: Sora Morimoto <sora@morimoto.io>
@smorimoto smorimoto requested review from hhugo and Copilot March 3, 2025 23:35

Choose a reason for hiding this comment

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

PR Overview

This PR updates constant imports to address the deprecation warning [DEP0008] by replacing the deprecated require of "node:constants" with the recommended "node:fs".

  • Replaced constant imports in the access and open methods with require("node:fs").constants
  • Ensured code changes follow Node.js best practices for accessing module-specific constants

Reviewed Changes

File Description
runtime/js/fs_node.js Updated require statements in the access and open methods to use "node:fs".

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Signed-off-by: Sora Morimoto <sora@morimoto.io>
@hhugo hhugo merged commit cc2cbd5 into master Mar 4, 2025
30 of 31 checks passed
@hhugo hhugo deleted the no-node-constants branch March 4, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants