awv3-protocol

7.5.4 • Public • Published
npm install awv3-protocol

▲ API

pack

Raw deflates and base64-encodes an ArrayBuffer, the result will be a string.

import pack from 'awv3-protocol/pack'
 
const result = { command: 'Blob', data: pack(arrayBuffer) }

inflate

Inflates a zipped/base64 encoded stream back into string-shape.

import inflate from 'awv3-protocol/inflate'
 
const result = inflate(stream)

unpack

Unpack raw inflates, base64-decodes blobs ({ command: 'Blob', data: ... }). It uses multiple cores to deal with several objects at once. The result will be multiple, optimized json objects, containing meshes, lines, materials, meta data and so on. unpack returns a promise, when it resolves object has been fully unpacked.

import unpack from 'awv3-protocol/unpack'
 
unpack(object, data => ... ).then( ... )

▲ BUILD PRE-REQUISITES

node >= 6.0 (https://nodejs.org/en/download/current/)
npm  >= 3.0 (pre-installed by node)
yarn        (npm install yarn -g)

▲ INSTALL DEPENDENCIES AND BUILD

yarn
yarn start

▲ TESTING & ALIASING

awv3-protocol build a packed webworker, hence it needs to create a distributable via npm start. Without this step aliasing to the raw code will cause errors!

Readme

Keywords

none

Package Sidebar

Install

npm i awv3-protocol

Weekly Downloads

20

Version

7.5.4

License

ISC

Unpacked Size

95.5 kB

Total Files

9

Last publish

Collaborators

  • drcmda
  • phipsy7