From 0c66cebc65cea6b62c2440caf1486d29c957dfdd Mon Sep 17 00:00:00 2001 From: Alexander McCord <11488393+alexmccord@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:32:19 -0800 Subject: [PATCH] Update docs/new-require-by-string-semantics.md --- docs/new-require-by-string-semantics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/new-require-by-string-semantics.md b/docs/new-require-by-string-semantics.md index 4426147..22e1a6c 100644 --- a/docs/new-require-by-string-semantics.md +++ b/docs/new-require-by-string-semantics.md @@ -57,7 +57,7 @@ local MyModule = require("../MyModule") local MyModule = require("../MyLibrary/MyModule") ``` -Relative paths must begin with `./` or `../`, which denote the directory of the requiring file and its parent directory, respectively. Disallowing implicit relative requires (`require("Foo")` resolves to `require("./Foo")`) disambiguates how requires will run. When a relative path does begin with one of these prefixes, it will only be resolved relative to the requiring file. If these prefixes are not provided, path resolution will fallback to checking the paths in the `paths` configuration variable, as described later. +Relative paths must begin with `./` or `../`, which denote the directory of the requiring file and its parent directory, respectively. Disallowing implicit relative requires (`require("Foo")` resolves to `require("./Foo")`) disambiguation of how requires will run. When a relative path does begin with one of these prefixes, it will only be resolved relative to the requiring file. If these prefixes are not provided, path resolution will fallback to checking the paths in the `paths` configuration variable, as described later. When a require statement is executed directly in a REPL input prompt (not in a file), relative paths will be evaluated in relation to the pseudo-file `stdin`, located in the current working directory. If the code being executed is not tied to a file (e.g. using `loadstring`), executing any require statements in this code will result in an error.