# Installation (/installation)

### JavaScript / TypeScript

```bash
npm install @lumis-sh/lumis @lumis-sh/themes @lumis-sh/wasm-javascript
```

Use `@lumis-sh/lumis` for the per-language WASM runtime and
`@lumis-sh/themes` for bundled themes. A parser is an ordinary dependency too:
add one `@lumis-sh/wasm-*` package per language you highlight, or a bundle such
as `@lumis-sh/wasm-bundle-web`, and import the language from it:

```js
import javascript from '@lumis-sh/wasm-javascript';
```

Node.js, Bun, Deno, edge runtimes such as Supabase Edge Functions, Cloudflare
Workers and Vercel, and browsers use the same imports. The packages include
TypeScript declarations; JavaScript and TypeScript apps use the same imports.
The [language catalog](/reference/languages) has every npm package name.
See [Declaring parsers](/advanced/lock) for package selection and
[Preloading languages](/languages) to load them before highlighting.

### Rust

```bash
cargo add lumis
```

### Elixir

```elixir
def deps do
  [
    {:lumis, "~> 0.10"},
    {:lumis_wasm_elixir, "~> 0.26.0"}
  ]
end
```

A parser is an ordinary dependency. Add one `lumis_wasm_*` package per language
you highlight, or a bundle such as `{:lumis_wasm_bundle_web, "~> 0.1"}`. Nothing
is fetched at runtime: a document's own language missing is an error, and a
language injected inside it missing costs that block its highlighting. The
[language catalog](/reference/languages) has every Hex package name.

Lumis loads installed parsers as needed and reuses them across requests.
You can also [preload languages](/languages) at application startup.

### Java

Community-maintained by [roastedroot](https://github.com/roastedroot/lumis4j).

```xml
<dependency>
  <groupId>io.roastedroot</groupId>
  <artifactId>lumis4j</artifactId>
  <version>0.0.7</version>
</dependency>
```

### Python

Community-maintained by [Answer.AI](https://github.com/AnswerDotAI/fastpylight).

```sh
pip install fastpylight
```

See the [Python guide](/usage/python) for HTML output, theme CSS, and language detection.

### CLI

```bash
curl -LsSf https://lumis.sh/install.sh | sh
```

See [Install the CLI](/cli/install) for Windows instructions and more installation options.

With Homebrew:

```bash
brew trust --tap leandrocp/lumis
brew tap leandrocp/lumis
brew install lumis
```

Through npm instead:

```bash
npx @lumis-sh/cli --help
```

For a global install:

```bash
npm install -g @lumis-sh/cli
```

Run `lumis --help` to see the available commands.

### Browsers / CDN

```html
<script type="module">
  import {highlight} from 'https://cdn.jsdelivr.net/npm/@lumis-sh/lumis/+esm';
  import {
    htmlInline,
  } from 'https://cdn.jsdelivr.net/npm/@lumis-sh/lumis/dist/formatters.js';
  import frappe from 'https://cdn.jsdelivr.net/npm/@lumis-sh/themes/dist/themes/catppuccin_frappe.js';
  // A browser loads only the parser packages you import.
  import javascript from 'https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-javascript/+esm';

  const html = await highlight(
    'const x = 1',
    htmlInline({language: javascript, theme: frappe})
  );

  document.getElementById('output').innerHTML = html;
</script>
```

### Edge / Workers

```bash
npm install @lumis-sh/lumis @lumis-sh/themes @lumis-sh/wasm-javascript
```

The same package runs on Supabase Edge Functions, Cloudflare Workers and
Vercel. See [Edge / Workers](/usage/edge) for each host's setup.


Choose one of Lumis's 8 runtimes above. [Lumis4J](/usage/java) for Java and [fastpylight](/usage/python) for Python are community-maintained packages with their own APIs and releases.