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 8626133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:57:05+00:00 2026-06-12T07:57:05+00:00

Why is the this an empty object in NodeJS? Where does the module.exports belongs

  • 0

Why is the “this” an empty object in NodeJS?
Where does the “module.exports” belongs to?

I thought that "module.exports..." could be written as "this.module.exports..." but it won’t work.

Thank you

  • 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-06-12T07:57:07+00:00Added an answer on June 12, 2026 at 7:57 am

    If you are in an actual module:

    • module is a reference to the current module

    • exports is a reference to the exported data. It gets cached away by NodeJS and delivered to other modules that require it

    • this is an alternate reference to the exports object

    • module.exports is an alternate reference to the exports object

    • this.module is undefined

    this is empty because as noted above it is a reference to the same object as exports, which is to be populated by the developer.

    If this.module was a reference to module, then since this is a reference to exports, it would export the module itself along with the other exported items. I doubt this would be desired.


    If you are in the REPL, then this.module is defined.

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

Sidebar

Related Questions

Why does this empty the text immediately (ignoring delay)? $('#error_box_text').html('error text').delay(5000).html('') # jQuery 1.4
I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
Consider this code: // Creating an empty object, without inheriting (binding) to any prototype
Usually I work with NoResultException to return an empty object, e.g. an empty error
class Test { enum{}; ... }; Is this empty enum definition portable? Compiles in
if ([dict objectForKey:@photo] !=(id)[NSNull null]) {NSLOG(@dictinary is not empty)} This is not working for
Assembly.Location gives a plain path to the assembly. Unfortunately this is empty when running
This returns an empty string when I try to determine the default text direction...
I have a selectmenu like this: $(#Menu).empty(); for (i = 0; i < data.length;
Can someone explain to me why this returns an empty string () instead of

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.