# farm-plugin-compression

> A rust plugin for [farm](https://github.com/farm-fe/farm) to compress resources.

Latest version **0.1.3** (published 2024-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install farm-plugin-compression
pnpm add farm-plugin-compression
yarn add farm-plugin-compression
bun add farm-plugin-compression
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2024-07-25 |
| First published | 2024-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | weeken |
| Keywords | farm, farm plugin, farm-plugin, farm-plugin-compression, rust plugin, compression, gz, .gz |

## Links

- npm: https://www.npmjs.com/package/farm-plugin-compression
- Homepage: https://github.com/Weeken/farm-plugin-compression
- npm.io page: https://npm.io/package/farm-plugin-compression

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2024-07-25
- 0.1.2 — 2024-07-19
- 0.1.1 — 2024-07-16
- 0.0.4 — 2024-05-08
- 0.0.3 — 2024-04-12
- 0.0.2 — 2024-04-11
- 0.0.1 — 2024-04-11

## README

## farm-plugin-compression

A rust plugin for [farm](https://github.com/farm-fe/farm) to compress resources.

### Install

```bash
pnpm add -D farm-plugin-compression
```

> [!NOTE]
> "@farmfe/core": "^1.2.0" --> "farm-plugin-compression": "0.0.4"  
> "@farmfe/core": "^1.3.0" --> "farm-plugin-compression": "^0.1.x"

### Usage

```ts
import { defineConfig } from "@farmfe/core";
import compression from "farm-plugin-compression";

export default defineConfig({
  plugins: [
    [
      "farm-plugin-compression",
      {
        level: "best", // level: "best" | "none" | "default" | "fast"
        exclude: ["jpg", "png"], // resource type like jpg, png, and others generate in dist
      },
    ],
    // or
    compression({ level: "best", exclude: ["jpg", "png"] }),
  ],
});
```

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