Installations
npm install nv-tary-shared-basic
Developer Guide
BETA
Typescript
No
Module System
CommonJS
Node Version
16.13.1
NPM Version
8.1.2
Score
71
Supply Chain
98.3
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Download Statistics
Total Downloads
613
Last Day
1
Last Week
2
Last Month
13
Last Year
75
Bundle Size
2.87 kB
Minified
1.10 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.3
Package Id
nv-tary-shared-basic@1.0.3
Unpacked Size
13.19 kB
Size
2.47 kB
File Count
3
NPM Version
8.1.2
Node Version
16.13.1
Total Downloads
Cumulative downloads
Total Downloads
613
Last day
-66.7%
1
Compared to previous day
Last week
-77.8%
2
Compared to previous week
Last month
160%
13
Compared to previous month
Last year
-27.9%
75
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
Versions
nv-tary-shared-basic
- nv-tary-shared-basic creat a shared-array-buffer AND a TypedArray-view
- creat many-view of same shared-array-buf
- for parser in worker-thread using, normally USELESS
install
- npm install nv-tary-shared-basic
usage
example
> var rslt = x.creat_many(128,["u8","u64","f32"])
> rslt
{
buf: SharedArrayBuffer {
[Uint8Contents]: <00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 28 more bytes>,
byteLength: 128
},
view: {
u8: Uint8Array(128) [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
... 28 more items
],
bu64: BigUint64Array(16) [
0n, 0n, 0n, 0n, 0n, 0n,
0n, 0n, 0n, 0n, 0n, 0n,
0n, 0n, 0n, 0n
],
f32: Float32Array(32) [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
]
}
}
>
rslt.view.f32[0] = 1.33333333333333333333
> rslt
{
buf: SharedArrayBuffer {
[Uint8Contents]: <ab aa aa 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 28 more bytes>,
byteLength: 128
},
view: {
u8: Uint8Array(128) [
171, 170, 170, 63, //========> use this to serialize float
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
... 28 more items
],
bu64: BigUint64Array(16) [
1068149419n, //========>
0n,
0n, 0n,
0n, 0n,
0n, 0n,
0n, 0n,
0n, 0n,
0n, 0n,
0n, 0n
],
f32: Float32Array(32) [
1.3333333730697632, //========>
0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0
]
}
}
>
APIS
const DFLT_CFG = ()=>({
> x.DFLT_CFG()
{ use_float: false, signed: false, clamped: false }
>
const NAMES = [
"u8","u8c","u16","u32",
"bu64","u64",
"i8","i16","i32",
"bi64","i64",
"f32","f64"
];
const SAB = SharedArrayBuffer;
const U8 = Uint8Array;
const U8C = Uint8ClampedArray;
const U16 = Uint16Array;
const U32 = Uint32Array;
const I8 = Int8Array;
const I16 = Int16Array;
const I32 = Int32Array;
const F32 = Float32Array;
const F64 = Float64Array;
const BI64 = BigInt64Array;
const I64 = BI64;
const BU64 = BigUint64Array;
const U64 = BU64;
const _u8 = (sab) => new U8(sab);
const u8 = (byte_sz) => {
const _u8c = (sab) => new U8C(sab);
const u8c = (byte_sz) => {
const _u16 = (sab) => new U16(sab);
const u16 = (byte_sz) => {
const _u32 = (sab) => new U32(sab);
const u32 = (byte_sz) => {
const _bu64 = (sab) => new BU64(sab);
const bu64 = (byte_sz) => {
const _i8 = (sab) => new I8(sab);
const i8 = (byte_sz) => {
const _i16 = (sab) => new I16(sab);
const i16 = (byte_sz) => {
const _i32 = (sab) => new I32(sab);
const i32 = (byte_sz) => {
const _bi64 = (sab) => new BI64(sab);
const bi64 = (byte_sz) => {
const _f32 = (sab) => new F32(sab);
const f32 = (byte_sz) => {
const _f64 = (sab) => new F64(sab);
const f64 = (byte_sz) => {
const _$unsigned = (sab,view_sz=8,clamped=false) => {
const $unsigned = (byte_sz,view_sz=8,clamped=false) => {
const _$signed = (sab,view_sz=8) => {
const $signed = (byte_sz,view_sz=8) => {
const _$float = (sab,view_sz=64) => {
const $float = (byte_sz,view_sz=64) => {
const DFLT_CFG = ()=>({
const _creat = (sab,view_sz,cfg=DFLT_CFG()) => {
const creat = (byte_sz,view_sz,cfg=DFLT_CFG()) => {
const parse_name_to_cfg = (name) => {
const _creat_many = (sab,names=["u8","u64"]) => {
const creat_many = (byte_sz,names=["u8","u64"])=> {
LICENSE
- ISC
No vulnerabilities found.
No security vulnerabilities found.