FAQ
The module object has these seven properties: exports, parent,
filename, paths, loaded, exited and children. In some sample code I
wrote, I see that the first five are getting set. However, it's not
clear to me when exited and children are set. I expected that
module.children would be an array of the modules that module had
required, but it's always empty in my code. Do those properties really
get set? If so, what triggers module.exited to get set to true?

--
R. Mark Volkmann
Object Computing, Inc.

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Nathan Rajlich at Mar 10, 2012 at 6:42 pm
    A quick look in module.js and grep through lib/ shows that they're never used...

    On Sat, Mar 10, 2012 at 10:38 AM, Mark Volkmann
    wrote:
    The module object has these seven properties: exports, parent,
    filename, paths, loaded, exited and children. In some sample code I
    wrote, I see that the first five are getting set. However, it's not
    clear to me when exited and children are set. I expected that
    module.children would be an array of the modules that module had
    required, but it's always empty in my code. Do those properties really
    get set? If so, what triggers module.exited to get set to true?

    --
    R. Mark Volkmann
    Object Computing, Inc.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Isaac Schlueter at Mar 12, 2012 at 5:09 pm
    Both properties are vestigial, from the days of require.async. It was
    necessary to keep track of whether or not a module had finished, and
    whether all of its children had finished, before returning to the
    callback.

    It doesn't look like much from the usage:

    require.async("some-module", function (er, someModule) {
    ...
    })

    and I'm sure someone from the AMD crowd will pipe in here about how
    easy it can be.

    However, this adds a lot of subtle complexity. If some-module
    requires some other things asynchronously, then it can create loops,
    and we need to be able to detect those, and not call the cb until
    everything is done loading and has exited.

    On Sat, Mar 10, 2012 at 10:41, Nathan Rajlich wrote:
    A quick look in module.js and grep through lib/ shows that they're never used...

    On Sat, Mar 10, 2012 at 10:38 AM, Mark Volkmann
    wrote:
    The module object has these seven properties: exports, parent,
    filename, paths, loaded, exited and children. In some sample code I
    wrote, I see that the first five are getting set. However, it's not
    clear to me when exited and children are set. I expected that
    module.children would be an array of the modules that module had
    required, but it's always empty in my code. Do those properties really
    get set? If so, what triggers module.exited to get set to true?

    --
    R. Mark Volkmann
    Object Computing, Inc.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedMar 10, '12 at 6:38p
activeMar 12, '12 at 5:09p
posts3
users3
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase