{"route":"/en-US-v0.13.1/reference/foundations/module/","title":"Module","description":"Documentation for the Module type.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]}],"body":{"kind":"type","content":{"name":"module","title":"Module","keywords":[],"oneliner":"An module of definitions.","details":"<p>An module of definitions.</p>\n<p>A module</p>\n<ul>\n<li>be built-in</li>\n<li>stem from a <a href=\"/en-US-v0.13.1/reference/scripting/#modules\">file import</a></li>\n<li>stem from a <a href=\"/en-US-v0.13.1/reference/scripting/#packages\">package import</a> (and thus indirectly\nits entrypoint file)</li>\n<li>result from a call to the <a href=\"/en-US-v0.13.1/reference/foundations/plugin/\">plugin</a> function</li>\n</ul>\n<p>You can access definitions from the module using <a href=\"/en-US-v0.13.1/reference/scripting/#fields\">field access\nnotation</a> and interact with it using the <a href=\"/en-US-v0.13.1/reference/scripting/#modules\">import and\ninclude syntaxes</a>. Alternatively, it is possible to\nconvert a module to a dictionary, and therefore access its contents\ndynamically, using the <a href=\"/en-US-v0.13.1/reference/foundations/dictionary/#constructor\">dictionary constructor</a>.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">import</span> <span class=\"typ-str\">&quot;utils.typ&quot;</span>\n<span class=\"typ-pol\">#</span><span class=\"typ-pol\">utils</span><span class=\"typ-punct\">.</span><span class=\"typ-func\">add</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">2</span><span class=\"typ-punct\">,</span> <span class=\"typ-num\">5</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">import</span> utils<span class=\"typ-punct\">:</span> sub\n<span class=\"typ-func\">#</span><span class=\"typ-func\">sub</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">1</span><span class=\"typ-punct\">,</span> <span class=\"typ-num\">4</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/8ad38f6a26a534e6fad80f3544716fff.png\" alt=\"Preview\"></div></div>","constructor":null,"scope":[]}}}