About 933,000 results
Open links in new tab
  1. JavaScript Require – How to Use the require () Function in JS

    Jan 31, 2023 · In this article, you will learn what the require() function does, how you can use it, and some distinct differences between the require and import functions. For a long time, the …

  2. What is "require" in JavaScript and NodeJS? - Stack Overflow

    The require() method is used to load and cache JavaScript modules. So, if you want to load a local, relative JavaScript module into a Node.js application, you can simply use the require() …

  3. JavaScript modules - JavaScript | MDN - MDN Web Docs

    Nov 3, 2025 · To get modules to work correctly in a browser, you need to make sure that your server is serving them with a Content-Type header that contains a JavaScript MIME type such …

  4. JavaScript Require – How to Use the require () Function in JS

    Aug 28, 2024 · To import a module, you just need to call require() and assign the result: The first example imports a local module file. The second imports the Node.js "fs" core module. You …

  5. JavaScript - Require () Function - Online Tutorials Library

    The require () method, a built-in CommonJS module function that Node.js supports, is how you add modules to your project. The reason for this is that by default, Node.js treats JavaScript …

  6. Require vs Import in Node.js: Understanding the Difference and …

    3 days ago · Node.js, the runtime environment for executing JavaScript outside the browser, relies heavily on modules to organize code, promote reusability, and avoid global scope pollution. …

  7. What is 'require' in JavaScript and NodeJS? A Practical Guide with ...

    Nov 8, 2025 · In this guide, we’ll demystify `require`: how it works, why it’s essential, and how to use it in real-world scenarios—including a practical example with a PostgreSQL database. By …

  8. require in JavaScript – How to use require () function? - codedamn

    Jun 3, 2023 · The require() function is an integral part of the CommonJS module system, which is used in Node.js for managing dependencies and modularizing code. The function allows you …

  9. JavaScript Require – A Comprehensive Guide to the require () …

    In this comprehensive guide, I‘ll walk through everything you need to know about require() – from basic syntax to advanced usage and best practices. Whether you‘re new to Node development …

  10. RequireJS

    RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node.