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

doc: move DEP0130 to a runtime deprecation #27951

Merged
merged 2 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2451,14 +2451,18 @@ instead.
### DEP0130: Module.createRequireFromPath()
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/27951
description: Runtime deprecation.
- version: v12.2.0
pr-url: https://github.com/nodejs/node/pull/27405
description: Documentation-only.
-->

Type: Documentation-only
Type: Runtime

Module.createRequireFromPath() is deprecated. Please use [`module.createRequire()`][] instead.
Module.createRequireFromPath() is deprecated. Please use
[`module.createRequire()`][] instead.

<a id="DEP0131"></a>
### DEP0131: Legacy HTTP parser
Expand Down
7 changes: 6 additions & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,12 @@ function createRequireFromPath(filename) {
return makeRequireFunction(m);
}

Module.createRequireFromPath = createRequireFromPath;
Module.createRequireFromPath = deprecate(
createRequireFromPath,
'Module.createRequireFromPath() is deprecated. ' +
'Use Module.createRequire() instead.',
'DEP0130'
);

const createRequireError = 'must be a file URL object, file URL string, or ' +
'absolute path string';
Expand Down
1 change: 1 addition & 0 deletions test/message/async_error_sync_esm.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Error: test
at async three (*fixtures*async-error.js:20:3)
at async four (*fixtures*async-error.js:24:3)
at async main (*message*async_error_sync_esm.mjs:7:5)
(node:*) [DEP0130] DeprecationWarning: Module.createRequireFromPath() is deprecated. Use Module.createRequire() instead.