# image-source-loader

> Image source loader for webpack

Latest version **0.6.5** (published 2018-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-source-loader
pnpm add image-source-loader
yarn add image-source-loader
bun add image-source-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.5 |
| Published | 2018-07-27 |
| First published | 2017-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wintercn, yacheng, yuanyan, zeroling |
| Keywords | base64, image, webpack, loader, img, src |

## Links

- npm: https://www.npmjs.com/package/image-source-loader
- Repository: https://github.com/alibaba/rax
- Homepage: https://github.com/alibaba/rax#readme
- Issues: https://github.com/alibaba/rax/issues
- npm.io page: https://npm.io/package/image-source-loader

## Dependencies (1)

- [image-size](https://npm.io/package/image-size.md) ^0.5.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.6.5 (latest) — 2018-07-27
- 0.6.4 — 2018-06-07
- 0.6.3 — 2018-05-08
- 0.6.2 — 2018-05-08
- 0.6.1 — 2018-04-23
- 0.6.0 — 2018-04-10
- 0.5.4 — 2018-03-02
- 0.5.2 — 2018-01-30
- 0.5.1 — 2018-01-25
- 0.5.0 — 2017-12-13
- 0.4.20 — 2017-10-18
- 0.4.19 — 2017-10-17
- 0.4.18 — 2017-10-16
- 0.4.17 — 2017-10-11
- 0.4.16 — 2017-09-28
- … 36 more at https://npm.io/package/image-source-loader/versions

## README

# image source loader for webpack

A source is an object contains: base64 uri, width and height of a image. eg: `{ uri: 'data:image/png;base64, iVBxxxx...', width: 2, height: 3 }`

If your looking for a loader that simple encodes as base64 try [base64-loader](https://github.com/antelle/base64-loader)

## Installation

`npm install image-source-loader`

## Usage

``` javascript
const source = require("image-source!./1x1.png");

// source => {
//   uri: "data:image/png;base64,iVBORw0KGgoAAAANS...",
//   width: 1,
//   height: 1
// }
```

[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)

## Support

See ./mimes.json for currently supported extensions/mimes.  
Create a Pull Request if you need more added.

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