# arraybuffer-loader

> Webpack loader that returns file contents as a ArrayBuffer

Latest version **1.0.8** (published 2019-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install arraybuffer-loader
pnpm add arraybuffer-loader
yarn add arraybuffer-loader
bun add arraybuffer-loader
```

## 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.8 |
| Published | 2019-10-12 |
| First published | 2016-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Author | Pine Mizune |
| Maintainers | pine613 |

## Links

- npm: https://www.npmjs.com/package/arraybuffer-loader
- Repository: https://github.com/pine/arraybuffer-loader
- Issues: https://github.com/pine/arraybuffer-loader/issues
- npm.io page: https://npm.io/package/arraybuffer-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0

## Recent versions

- 1.0.8 (latest) — 2019-10-12
- 1.0.7 — 2018-10-24
- 1.0.6 — 2018-07-23
- 1.0.4 — 2018-05-13
- 1.0.3 — 2018-01-31
- 1.0.2 — 2018-01-14
- 1.0.1 — 2017-12-28
- 1.0.0 — 2017-12-13
- 0.2.2 — 2017-01-19
- 0.2.1 — 2016-08-03
- 0.2.0 — 2016-07-27
- 0.1.1 — 2016-07-26
- 0.1.0 — 2016-07-26

## README

ArrayBuffer loader for webpack
------------------------------

[![NPM](https://nodei.co/npm/arraybuffer-loader.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/arraybuffer-loader/)

[![npm](https://img.shields.io/npm/v/arraybuffer-loader.svg?maxAge=2592000)](https://www.npmjs.org/package/arraybuffer-loader)
[![Travis](https://img.shields.io/travis/pine/arraybuffer-loader/master.svg?maxAge=2592000)](https://travis-ci.org/pine/arraybuffer-loader)
[![Build status](https://ci.appveyor.com/api/projects/status/0p14m3bkv130m916/branch/master?svg=true)](https://ci.appveyor.com/project/pine/arraybuffer-loader/branch/master)
[![Dependency Status](https://img.shields.io/david/pine/arraybuffer-loader.svg?maxAge=2592000)](https://david-dm.org/pine/arraybuffer-loader)
[![devDependency Status](https://img.shields.io/david/dev/pine/arraybuffer-loader.svg?maxAge=2592000)](https://david-dm.org/pine/arraybuffer-loader?type=dev)
[![Maintainability](https://api.codeclimate.com/v1/badges/b3adc2dc975b010a6e92/maintainability)](https://codeclimate.com/github/pine/arraybuffer-loader/maintainability)
[![Greenkeeper badge](https://badges.greenkeeper.io/pine/arraybuffer-loader.svg)](https://greenkeeper.io/)


## Supported Platforms

- Modern Browsers (IE >= 10)
- Node.js

## Getting Started


```
$ yarn add arraybuffer-loader
```

or

```
$ npm install arraybuffer-loader --save-dev
```

## Usage
If you read only the specific extensions (e.g. wasm), please add loader in `webpack.config.js`.

```js
module: {
  rules: [
    {
      test: /\.png$/,
      loaders: ['arraybuffer-loader'],
    },
  ],
},
```

Or if reading an arbitrary extension, use `require`.

```js
const buffer = require('arraybuffer!./data.dat')
const array = new Uint8Array(buffer)
```

See also offical document [Loaders](https://webpack.js.org/concepts/loaders/).

### For `.wasm` file
Webpack 4 or later has embedded WASM parser. So, please set `type: 'javascript/auto'` when use `arraybuffer-loader`.

```js
module: {
  rules: [
    {
      test: /\.wasm$/,
      type: 'javascript/auto',
      loaders: ['arraybuffer-loader'],
    },
  ],
},
```

## License
MIT &copy; [Pine Mizune](https://profile.pine.moe)

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