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

  • Home
  • SEARCH
  • 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 8262349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:43:47+00:00 2026-06-08T03:43:47+00:00

I usually find this as the first line in node.js scripts/modules as well as

  • 0

I usually find this as the first line in node.js scripts/modules as well as phantomJS, casperJS etc. I’m curious, if this is a common pattern for server-side javascript (SSJS) (similar to #include in C/C++ or import in Java) or is it a a library like RequireJS or LabJS that is being called for this inclusion (neither of which I have gotten a chance to use in practice, as yet)?

e.g. var http = require('http') or var casper = require('casper').create()

I’m curious if this is a pattern that has become standardized for SSJS or does every library/tool call an existing function?

Please pardon the n00b dimension to the question but I would like to know the ‘why’ behind its omnipresence 🙂

  • 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-08T03:43:50+00:00Added an answer on June 8, 2026 at 3:43 am

    The require() idiom is part of a specification known as CommonJS. Specifically, that part of the spec is called ‘Modules’. RequireJS is just one implementation of CommonJS (and it’s usually a browser-side implementation – in fact, it takes a different approach because of the asynchronous nature of the browser).

    If you look at the list of implementations on the CommonJS site, you’ll see Node.js listed. Notice that it implements ‘Modules’. Hence, that’s where it’s coming from – it’s very much built-in.

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

Sidebar

Related Questions

This is the 1st time I am using stackoverflow, I usually find answers to
I usually use like this $ find -name testname.c ./dir1/dir2/testname.c $ vi ./dir1/dir2/testname.c it's
First time asking a question here. Usually I can find my answer without having
When inserting a new line character into a string I have usually done this:
this is my first question in stackoverflow, usually I'm used to searching the internet
I'm planning to make a simple Photo Resizer since I usually find myself having
In most pieces of pseudocode, I usually find the following: DeleteMin (Return the element
Usually when I need to find the max value of an array I use
Sometimes I need to find some strings inside DB usually it is just host-name
I usually play with elisp code on my scratch buffer. I find it hard

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.