My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Recursive require Best Practice in NodeJS

Recursive require Best Practice in NodeJS

Vaibhav Mule's photo
Vaibhav Mule
·Jan 12, 2016

There is file called read.js and resolveJoins.js.

Both are utility file that require each other.

Right, I'm requiring them when I need it as Modules are cached after the first time they are loaded.

What is best practice to do Recursive require

1st : github.com/Mindgreppers/OHHDL/blob/dev/back..

2nd: github.com/Mindgreppers/OHHDL/blob/dev/back..