What Does Require Do

RisingStack's services:

Node.js Experts

Learn more at risingstack.com

Sign up to our newsletter!

In this article:

When a module is loaded using the require() function, the module’s code is executed and the exports object of the module is returned. The require() function can be used to load local files as well as modules installed from npm.

Share this post

Twitter
Facebook
LinkedIn
Reddit