Top "Require" questions

In interpreted languages like Lua, PHP and Ruby, "require" is a statement that tells the interpreter to include a certain source-file at that position where the "require" statement has been placed.

Cleanest/One-liner way to require all files in directory in Ruby?

When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb `-- helpers |-- helper_a.…

ruby require
In Node.js, am I creating a new object when "Require"?

So, what I'm not sure is that. if in ModuleA, I have: var mongoose = require('mongoose'); mongoose.connect(pathA); And …

node.js require mongoose
How do I change the order in which Meteor loads Javascript files?

When you make a project with the Meteor framework, it packages all the files together, but there doesn't seem to …

javascript dependencies meteor require
Rails 3 library not loading until require

I'm trying to load the Tokbox SDK in rails 3. I've placed the library in my /lib directory, so currently my …

ruby-on-rails-3 require
Rails 3: how to load files in /lib?

I'm new to rails and making some sort of noob mistake: I frequently need to count the number of lines …

ruby-on-rails-3 require autoload
Getting closure-compiler and Node.js to play nice

Are there any projects that used node.js and closure-compiler (CC for short) together? The official CC recommendation is to …

javascript node.js require google-closure-compiler
file_exists() or is_readable()

Which one should you use when you want to include a PHP file? if(file_exists($file) require "$file"; or …

php include require file-exists
Ruby: how to "require" a file from the current working dir?

How do I require a file from the current folder? I have a file called sql_parser.rb that contains …

ruby require
React Native require(image) returns number

I have a js file with one component EventCard, which takes event name, date, event image etc. If event image …

javascript reactjs react-native require
All caps constants in JavaScript. And requireds. And imports

I was used to declare constant values using all caps. Then I started using const for any value that never …

javascript import constants require