Skip to content

pine/arraybuffer-loader

Repository files navigation

ArrayBuffer loader for webpack

NPM

npm Travis Build status Dependency Status devDependency Status FOSSA Status Greenkeeper badge

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.

module: {
  loaders: [
    {
      test: /\.wasm$/,
      loaders: ['arraybuffer-loader'],
    },
  ],
},

Or if reading an arbitrary extension, use require.

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

See also offical document Loaders.

License

MIT © Pine Mizune

FOSSA Status