Offload functions to worker threads with shared memory primitives for Node.js.
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

at e2cebd539403475e2f4e79d55ca1a84a0ce3510d 24 lines 558 B view raw
1import { describe, it } from 'node:test'; 2import assert from 'node:assert/strict'; 3import { int16 } from 'moroutine'; 4 5describe('Int16', () => { 6 it('self-allocates and initializes to zero', () => { 7 const v = int16(); 8 assert.equal(v.load(), 0); 9 }); 10 11 it('stores and loads a value', () => { 12 const v = int16(); 13 v.store(42); 14 assert.equal(v.load(), 42); 15 }); 16 17 it('exposes byteSize of 2', () => { 18 assert.equal(int16.byteSize, 2); 19 }); 20 21 it('exposes byteAlignment of 2', () => { 22 assert.equal(int16.byteAlignment, 2); 23 }); 24});