# bun-plugin-proto

> Adds support for .proto imports in Bun.

Latest version **0.1.0** (published 2023-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install bun-plugin-proto
pnpm add bun-plugin-proto
yarn add bun-plugin-proto
bun add bun-plugin-proto
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-09-11 |
| First published | 2023-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Robert Soriano |
| Maintainers | wobsoriano |
| Keywords | bun |

## Links

- npm: https://www.npmjs.com/package/bun-plugin-proto
- Repository: https://github.com/wobsoriano/bun-plugin-proto
- Homepage: https://github.com/wobsoriano/bun-plugin-proto#readme
- Issues: https://github.com/wobsoriano/bun-plugin-proto/issues
- npm.io page: https://npm.io/package/bun-plugin-proto

## Dependencies (1)

- [@grpc/proto-loader](https://npm.io/package/@grpc/proto-loader.md) ^0.7.9

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2023-09-11

## README

# bun-plugin-proto

Adds support for .proto imports in Bun.

## Installation

```bash
bun add bun-plugin-proto -d
```

## Bundler usage

```ts
import proto from "bun-plugin-proto";

Bun.build({
  // other config
  plugins: [
    proto()
  ],
});
```

In your sources you can now import proto files

```ts
import packageDefinition from './file.proto'

console.log(packageDefinition)
```

The contents of the packageDefinition will be inlined into your bundle.

## Runtime usage

To use as a runtime plugin, create a file that registers the plugin:

```ts
// proto.ts
import proto from 'bun-plugin-proto'

Bun.plugin(proto({}));
```

Then preload it in your `bunfig.toml`:

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

## License

MIT

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