# snowpack-plugin-inliner

> A plugin for snowpack which transforms files into base64 URIs

Latest version **1.0.3** (published 2021-08-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install snowpack-plugin-inliner
pnpm add snowpack-plugin-inliner
yarn add snowpack-plugin-inliner
bun add snowpack-plugin-inliner
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-08-12 |
| First published | 2020-08-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | senze.fan |
| Maintainers | senze.fan |
| Keywords | snowpack, image, url, inliner, base64, snowpack-plugin |

## Links

- npm: https://www.npmjs.com/package/snowpack-plugin-inliner
- Repository: https://github.com/fansenze/snowpack-plugin-inliner
- Homepage: https://github.com/fansenze/snowpack-plugin-inliner#readme
- Issues: https://github.com/fansenze/snowpack-plugin-inliner/issues
- npm.io page: https://npm.io/package/snowpack-plugin-inliner

## Dependencies (1)

- [mime](https://npm.io/package/mime.md) ^2.4.6

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-08-12
- 1.0.2 — 2020-08-13
- 1.0.1 — 2020-08-12
- 1.0.0 — 2020-08-12

## README

# snowpack-plugin-inliner
A plugin for snowpack which transforms files into base64 URIs.

## Usage

### Install
```bash
npm install --save-dev snowpack-plugin-inliner
```

### Configuration
add this plugin to your Snowpack config:  

#### Commonly
**snowpack.config.json**
```json
{
  "plugins": [
    ["snowpack-plugin-inliner"]
  ]
}
```

#### Custom
**snowpack.config.js**
```javascript
module.exports = {
  "plugins": [
    ["snowpack-plugin-inliner", {
      "exts": ["jpg", "png"], // only "jpg" & "png" will be inlined with
      "limit": 66666, // set maximum of file size: 66666 bytes
    }],
  ],
};
```

## Options

|             Name              |            Type             |                 Default                    | Description                                                                         |
| :---------------------------: | :-------------------------: | :----------------------------------------: | :---------------------------------------------------------------------------------- |
|          **`exts`**           |       `Array<string>`       |       `["jpg","jpeg","png","svg"]`         | Specifying the extensions of a file will be inlined with.                           |
|          **`limit`**          | `boolean | number | string` |                 `10240`                    | Specifying the maximum size of a file in bytes.                                     |
|          **`encoding`**       |          `string`           |                 `base64`                   | Specify the encoding which the file will be inlined with.                           |

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