Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:02:27+00:00 2026-05-23T02:02:27+00:00

In the node.js documentation regarding module caching , the following statement is made: Multiple

  • 0

In the node.js documentation regarding module caching, the following statement is made:

Multiple calls to require(‘foo’) may not cause the module code to be executed multiple times. This is an important feature. With it, “partially done” objects can be returned, thus allowing transitive dependencies to be loaded even when they would cause cycles.

I’m a bit confused about the last sentence. What is a “partially done” object? How does this relate to allowing (or avoiding) cyclical dependencies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:02:28+00:00Added an answer on May 23, 2026 at 2:02 am

    If you require a package from a file, and that causes a file in that package to require the file that caused the initial require then you have a cyclic dependency. By default, it would just go in circles. In order to prevent this, one can keep a marker where the original require started so that the next time that file is require‘d it will start from that point rather than the beginning. It’s not flawless, but in the case of loading a package you are generally only interested in the exports, and it works well in that case.

    I pushed a diff for node-browserify a while back for a primitive method of “partially done” exports. Basically, each time something is require‘d it will check the amount of exports. If there are more exports, it means the package was incomplete the last time, and could still be processing. If there are no new exports (the new and old count are equal), then it means the package is done, and can be cached so that the module code is not executed multiple times. Being that it is in the browser, there’s no control over execution flow, and thus the module code would be repeated partially (in steps) until done. Whereas I’m sure Node.js has more elegant handling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can node.js listen on UNIX socket? I did not find any documentation regarding this.
How do node.XPathSelectElement() and node.XPathSelectElements() behave when the selection is either not a NodeSet
I have been looking into Node.JS and all the documentation and blogs talk about
I have not been able to get drupal_get_form to pass on the node data.
I am not having success displaying an image at a node in dot. My
I am not talking about $(#demo1).jstree(rename,node) which makes the node editable for the user.
I've been trying to do the following: #[...] def __history_dependent_simulate(self, node, iterations=1, *args, **kwargs):
I've got some non-node data in a custom module of mine and I would
the erlang documentation says: erlang:now() [...] It is also guaranteed that subsequent calls to
Have some strange behaviour regarding output caching in an ASP.NET 4 application on IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.