Modules
ESM Import
Section titled “ESM Import”import express from ///express///import [useState, useEffect] from ///react///import React, [Component] from ///react///import all as fs from ///fs///Use (dot-path import)
Section titled “Use (dot-path import)”use std.mathfrom std.math use sin, cosimport * as math from "std/math";import { sin, cos } from "std/math";Export
Section titled “Export”pub fn helper to 42pub const VERSION be ///1.0///export default fn main console.log[///hi///]Module namespace (mod)
Section titled “Module namespace (mod)”mod utils fn helper to 42const utils = (() => { function helper() { return 42; }})();CommonJS
Section titled “CommonJS”const fs be require[///fs///]const fs = require("fs");