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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:27:51+00:00 2026-06-07T01:27:51+00:00

Quick question, but one I surprisingly couldn’t find the answer for with a bit

  • 0

Quick question, but one I surprisingly couldn’t find the answer for with a bit of Googling… when I use the node interactive interpreter, I can type in the names of basically all core modules and see them output as objects onto the console… however, I understand that the core modules aren’t all included like this by default when running a .js file.

Can anyone clear this up for me? All help appreciated.

  • 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-07T01:27:52+00:00Added an answer on June 7, 2026 at 1:27 am

    Starting in Node 0.8, repl.js defines a list of built-in libraries that will be automatically required when you type their name on the REPL:

    exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
      'crypto', 'dgram', 'dns', 'events', 'fs', 'http', 'https', 'net',
      'os', 'path', 'punycode', 'querystring', 'readline', 'repl',
      'string_decoder', 'tls', 'tty', 'url', 'util', 'vm', 'zlib'];
    
    ...
    
    if (exports._builtinLibs.indexOf(cmd) !== -1) {
      var lib = require(cmd);
      if (cmd in self.context && lib !== self.context[cmd]) {
        self.outputStream.write('A different "' + cmd +
                                '" already exists globally\n');
      } else {
        self.context._ = self.context[cmd] = lib;
        self.outputStream.write(self.writer(lib) + '\n');
      }
      self.displayPrompt();
      return;
    }
    

    This is specifically a function of repl.js, and does not work at all in any way when writing your own Node.js programs; there, you must specifically require anything you want to use.

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

Sidebar

Related Questions

Quick question (and sorry if it's already been asked, I have looked but couldn't
Quick question. I'm in a bit of a rush but if someone could quickly
Quick question: One can set the path where a cookie is valid, but is
Quick question. I have been Googling this all morning, but it's either not there,
A quick question, that I can't seem to find the answer to anywhere to
quick question.. I'm trying to make two variables appear in one text box but
Im relatively new to the Android world but I have a quick question. I
just a quick question, was trying different ways to accomplish this, but ended with
Quick question, indexof() find the first occur position of the string character? what about
Quick question, I was wondering if there is a way to use Solr's API

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.