Skip to content

About

The buffer module from node.js, for the lwc developer.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

LWC Buffer

lwc-buffer The buffer module from node.js, for the lwc developer. Base on buffer.

features

  • Manipulate binary data like a boss, in all browsers!
  • Super fast. Backed by Typed Arrays (Uint8Array/ArrayBuffer, not Object)
  • Extremely small bundle size (6.75KB minified + gzipped, 51.9KB with comments)
  • Excellent browser support (Chrome, Firefox, Edge, Safari 11+, iOS 11+, Android, etc.)
  • Preserves Node API exactly, with one minor difference (see below)
  • Square-bracket buf[4] notation works!
  • Does not modify any browser prototypes or put anything on window
  • Comprehensive test suite (including all buffer tests from node.js core)

deploy lwc-buffer

Deploy to Salesforce

or

git clone https://github.com/exiahuang/lwc-buffer.git
cd lwc-buffer
sfdx force:source:deploy --loglevel fatal -p force-app/main/default/lwc/buffer/buffer.js-meta.xml --targetusername=$username_or_alias_for_your_sfdc_org

usage

import buffer from 'c/buffer';
const Buffer = buffer.Buffer;

const buf = Buffer.from([1, 2, 3]);
console.log(buf);

document

About

The buffer module from node.js, for the lwc developer.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages