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: createRequire() improvements #27762

Merged
merged 2 commits into from May 20, 2019

Conversation

@cjihrig
Copy link
Contributor

commented May 18, 2019

First commit:
Update the createRequire() example to use import and import.meta.url instead of require() and require.resolve().

I'm not so sure about the change here to .eslintrc.js. Based on eslint/eslint#8148, it doesn't seem possible to configure the parserOptions.sourceType per code block. If it is possible, I'm happy to make the change. Another option would be to just disable eslint for that code block.

Second commit:
This commit replaces createRequireFromPath() references with createRequire() references.

Fixes: #27758

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

Copy link

commented May 20, 2019

cjihrig added 2 commits May 18, 2019
doc: improve createRequire() example
Update the example to use import and import.meta.url instead
of require() and require.resolve().

PR-URL: #27762
Fixes: #27758
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
doc: replace createRequireFromPath() references
This commit replaces createRequireFromPath() references with
createRequire() references.

PR-URL: #27762
Fixes: #27758
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>

@cjihrig cjihrig force-pushed the cjihrig:doc branch from 513906d to 1b381d6 May 20, 2019

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2019

Landed in 64182e9...1b381d6.

@cjihrig cjihrig closed this May 20, 2019

@cjihrig cjihrig deleted the cjihrig:doc branch May 20, 2019

@cjihrig cjihrig merged commit 1b381d6 into nodejs:master May 20, 2019

1 of 2 checks passed

Travis CI - Pull Request Build Errored
Details
Travis CI - Branch Build Passed
Details
BridgeAR added a commit that referenced this pull request May 21, 2019
doc: improve createRequire() example
Update the example to use import and import.meta.url instead
of require() and require.resolve().

PR-URL: #27762
Fixes: #27758
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
BridgeAR added a commit that referenced this pull request May 21, 2019
doc: replace createRequireFromPath() references
This commit replaces createRequireFromPath() references with
createRequire() references.

PR-URL: #27762
Fixes: #27758
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
@BridgeAR BridgeAR referenced this pull request May 21, 2019
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.