Are you an LLM? You can read better optimized documentation at /guide/installation.md for this page in Markdown format
Installation
Lune is designed to be used without a build step. You can simply load it from a CDN.
CDN
html
<!-- For the ES module build -->
<script type="module">
import { createApp } from "https://esm.sh/lune-js";
createApp().mount();
</script>html
<script src="https://cdn.jsdelivr.net/npm/lune-js" defer init></script>html
<script src="https://unpkg.com/lune-js" defer init></script>Production Tip
For production, it is recommended to pin a specific version number to avoid unexpected breakage from newer versions.
html
<script src="https://cdn.jsdelivr.net/npm/lune-js@0.3.0" defer init></script>Package
You can also install Lune via your project's package manager:
sh
npm install lune-jssh
yarn add lune-jssh
pnpm add lune-js@latestsh
bun add lune-jssh
deno add npm:lune-jsThen import it in your project:
js
import { createApp } from "lune-js";
createApp().mount();Troubleshooting
Loading Order
Always use defer when loading Lune in the <head> to ensure the DOM is ready before Lune tries to initialize. If you put the script at the end of <body>, defer is not strictly necessary but still good practice.