open-index/open-npm huggingface dataset:
npm package: @gtramontina.com/elysia-htmx
Description: Elysia HTMX Context
Latest version: 2.0.0

# Elysia HTMX

Elysia plugin to support integration with [HTMX](https://htmx.org/).

## Installation

```bash
bun add --exact elysia-htmx
```

## Usage

```ts
import { htmx } from "elysia-htmx"; // 1. Import
import Elysia from "elysia";

new Elysia()
  .use(htmx()) // 2. Use
  .get("/", ({ hx }) => {
    return {
      request: hx.request,
      boosted: hx.boosted,
      historyRestoreRequest: hx.historyRestoreRequest,
      currentURL: hx.currentURL,
      prompt: hx.prompt,
      target: hx.target,
      triggerName: hx.triggerName,
      trigger: hx.trigger,
      isHTMX: hx.isHTMX,
    }
  })
  .listen(3000);
```

### API (Added Context)

```ts
type HtmxContext = {
    hx: {
        request: boolean;
        boosted: boolean;
        historyRestoreRequest: boolean;
        currentURL: string;
        prompt: string;
        target: string;
        triggerName: string;
        trigger: string;
        setLocation(url: string): void;
        pushURL(url: string): void;
        redirect(url: string): void;
        refresh(): void;
        replaceURL(url: string): void;
        reswap(value: HxSwap): void;
        retarget(elementSelector: string): void;
        reselect(elementSelector: string): void;
        triggerEvent(event: string | Record<string, unknown>): void;
        triggerEventAfterSettle(): void;
        triggerEventAfterSwap(): void;
        get isHTMX(): boolean;
        stopPolling(): void;
    };
};
```

For usage of the `hx` object, please refer to the [htmx](https://htmx.org/)'s [Request](https://htmx.org/reference/#request_headers) and [Response](https://htmx.org/reference/#response_headers) headers documentation.
npm package: @gtramontina.com/elysia-tailwind
Description: Elysia Tailwind Plugin
Latest version: 2.0.0

# Elysia Tailwind

Elysia plugin to compile and serve Tailwind-generated stylesheets.

## Installation

> [!NOTE]  
> This package moved to a new scope. If you were using [`elysia-tailwind`](https://www.npmjs.com/package/elysia-tailwind), you should update dependency and your imports to [`@gtramontina.com/elysia-tailwind`](https://www.npmjs.com/package/@gtramontina.com/elysia-tailwind) going forward.

```bash
bun add --exact @gtramontina.com/elysia-tailwind
```

## Usage

```ts
import { tailwind } from "@gtramontina.com/elysia-tailwind"; // 1. Import
import Elysia from "elysia";

new Elysia()
  .use(tailwind({                           // 2. Use
      path: "/public/stylesheet.css",       // 2.1 Where to serve the compiled stylesheet;
      source: "./source/styles.css",        // 2.2 Specify source file path (where your @tailwind directives are);
      config: "./tailwind.config.js",       // 2.3 Specify config file path or Config object;
      options: {                            // 2.4 Optionally Specify options:
          minify: true,                     // 2.4.1 Minify the output stylesheet (default: NODE_ENV === "production");
          map: true,                        // 2.4.2 Generate source map (default: NODE_ENV !== "production");
          autoprefixer: false               // 2.4.3 Whether to use autoprefixer;
      },
  }))
  .listen(3000);
```