@@ -16,8 +16,8 @@ The ``require()`` and ``load()`` methods include files and modules in
1616your scripts for added functionality. However, ``require()`` and
1717``load()`` differ in their behaviors and availability.
1818
19- Types of Scripts in `` mongosh``
20- -------------------------------
19+ Types of Scripts in mongosh
20+ ---------------------------
2121
2222You can use the following types of scripts with ``mongosh``:
2323
@@ -30,8 +30,8 @@ You can use the following types of scripts with ``mongosh``:
3030- Node.js scripts, which are any scripts loaded with ``require()``,
3131 including npm packages. These scripts are always files.
3232
33- Availability of `` require()`` and `` load()``
34- --------------------------------------------
33+ Availability of require() and load()
34+ ------------------------------------
3535
3636The ``require()`` and ``load()`` methods differ in availability
3737depending on the type of script you are using.
@@ -40,8 +40,8 @@ depending on the type of script you are using.
4040
4141- In Node.js scripts, only ``require()`` is available.
4242
43- File Paths for `` require()`` and `` load()``
44- -------------------------------------------
43+ File Paths for require() and load()
44+ -----------------------------------
4545
4646The type of script determines how you specify file paths with
4747``require()`` or ``load()``.
@@ -73,7 +73,7 @@ The type of script determines how you specify file paths with
7373 To change the shell's working directory, use the :ref:`cd()
7474 <mongosh-native-method-cd>` method in your script.
7575
76- Load External Code in a `` mongosh`` Script
76+ Load External Code in a mongosh Script
7777~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7878
7979You can load external code in a ``mongosh`` script file, such as an npm
@@ -111,8 +111,13 @@ package or a separate ``mongosh`` script.
111111 const localRequire = require('date-fns').createRequire(__filename);
112112 const fileExports = localRequire('./test-suite2.js'); }
113113
114- Access to the ``mongosh`` API
115- -----------------------------
114+ require() Packaging Considerations
115+ ----------------------------------
116+
117+ .. include:: /includes/scripting/fact-require-ems-modules.rst
118+
119+ Access to the mongosh API
120+ -------------------------
116121
117122- ``mongosh`` scripts can use the ``mongosh`` API.
118123
@@ -134,4 +139,3 @@ available inside of Node.js scripts.
134139 Generally, you should not keep mongosh-specific code inside Node.js
135140 scripts.
136141
137-
0 commit comments