# bun-html-importer

> To run plugin:

Latest version **0.0.2** (published 2023-09-21) · 0 weekly downloads

## Install

```sh
npm install bun-html-importer
pnpm add bun-html-importer
yarn add bun-html-importer
bun add bun-html-importer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-09-21 |
| First published | 2023-09-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | naseericehead |

## Links

- npm: https://www.npmjs.com/package/bun-html-importer
- Repository: https://github.com/the-einstein/bun-html-inporter
- Homepage: https://github.com/the-einstein/bun-html-inporter#readme
- Issues: https://github.com/the-einstein/bun-html-inporter/issues
- npm.io page: https://npm.io/package/bun-html-importer

## Recent versions

- 0.0.2 (latest) — 2023-09-21
- 0.0.1 — 2023-09-12

## README

# bun-html-importer
## Plugin to import html as a file in bun projects

To run plugin:

```javascript
import { plugin } from "bun";
import { bunHtmlImporterPlugin } from "bun-html-importer"

plugin(bunHtmlImporterPlugin)

```

here is sample implementation in Elysia project:

First we need to preload the plugin in core. To do this just run the file in which you are adding plugin into preload in bun config

```toml
preload = ['./html.ts']
```

And in the project you can easily import HTML file and it will return as a string

```javascript

import { Elysia } from "elysia";
import { html } from "@elysiajs/html";
import index from "./view/home/index.html";
import users from "./view/users/users.html";

const app = new Elysia().use(html()).get("/", () => index).get("/users", () => users).listen(3000);

console.log(
  `🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`
);

```

Ps. You need to configure your linters or tsconfig so that editor won't argue with problem of not finding html modules


# bun-html-inporter

---
_Source: https://npm.io/package/bun-html-importer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
