Home

require

Require is a verb meaning to deem something necessary or essential, or to demand that a condition be met. It expresses obligation or necessity, as in "This task requires concentration" or "A visa is required for entry." The noun form, requirement, denotes a condition or prerequisite; to be required means to be mandated or necessary.

Etymology: From Middle English, via Old French requerre, from Latin requirere "to seek again", re- + quaerere

Computing usage: In programming, require refers to a directive that loads code from another file or module.

Although related, the general English "require" and its programming use are distinct; context clarifies whether it

"to
seek".
The
sense
"to
demand"
developed
in
English
during
the
medieval
period.
In
Ruby,
require
loads
a
library
or
file.
In
PHP,
require
and
require_once
include
a
script
and
produce
a
fatal
error
if
the
file
cannot
be
found,
with
require_once
preventing
multiple
inclusions.
In
Node.js
and
many
CommonJS
environments,
require('module')
loads
a
module
at
runtime;
in
browser-based
module
systems,
similar
functions
exist
under
different
names
(for
example,
RequireJS).
refers
to
obligation
or
to
code-loading.