Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

a little mistake in document about modules #25864

Closed
opass opened this issue Aug 16, 2015 · 1 comment
Closed

a little mistake in document about modules #25864

opass opened this issue Aug 16, 2015 · 1 comment

Comments

@opass
Copy link

opass commented Aug 16, 2015

I found a little error while reading node document.

as the following link
https://nodejs.org/api/modules.html#modules_exports_alias

function require(...) {
  // ...
  function (module, exports) {
    // Your module code here
    exports = some_func;        // re-assigns exports, exports is no longer
                                // a shortcut, and nothing is exported.
    module.exports = some_func; // makes your module export 0
  } (module, module.exports);
  return module;
}

I am confused with the last line "return module". I think it should be "return module.exports" rather than "return module".

@brendanashworth
Copy link

Hi!

This repo is now an archive, mostly where issues go to die. If you'd like this to get any attention, I'd recommend opening an issue where development is now: https://github.com/nodejs/node.

I'll close this for now as I don't think a doc change like this would be backportable to 0.x.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants