0.0.2 • Published 5 years ago

@timvanscherpenzeel/typedarray-pool v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

TypedArray pool

npm.io npm version dependencies devDependencies

A global pool for typed arrays (923 B).

This library is a modern TypeScript port of the original typedarray-pool library by Mikola Lysenko with some API changes.

Installation

Make sure you have Node.js installed.

 $ npm install @timvanscherpenzeel/typedarray-pool

Usage

import { TypedArrayPool } from '@timvanscherpenzeel/typedarray-pool';

const typedArrayPool = new TypedArrayPool();

// Allocate a buffer with at least 128 floats
const f = typedArrayPool.malloc(128, 'FLOAT_32');

// ...

// When done, release buffer back to pool
typedArrayPool.free(f);

Development

$ yarn start

$ yarn lint

$ yarn test

$ yarn build

Licence

My work is released under the MIT license.

0.0.2

5 years ago

0.0.1

5 years ago