Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arraybuffer-lite-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arraybuffer-lite-loader

Webpack loader that returns file contents as a ArrayBuffer

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

ArrayBuffer loader for webpack

NPM

npm Travis Build status Dependency Status devDependency Status Maintainability 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: {
  rules: [
    {
      test: /\.png$/,
      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.

For .wasm file

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

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

License

MIT © Pine Mizune

FAQs

Package last updated on 15 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc