Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@bnaya/objectbuffer
Advanced tools
For Modern browsers and node. Zero direct dependencies.
The library offers you an API that have the look & feel of a regular javascript object, while the data is saved to an ArrayBuffer
that can be shared or transferred to a WebWorker
.
The library is still not complete, and will never offer full compatibility with plain js objects due, to the nature of the language and the problems space.
See also main.js for shared memory example.
to run it: clone the repo, yarn install
and yarn browser-playground
Exchanging data with WebWorkers
(other than ArrayBuffer) is done by serializing and copying the data to the other side.
for some use-cases, it's slow and memory expensive.
ArrayBuffer
can be transferred
without a copy, and SharedArrayBuffer
can be directly shared, but out of the box, it's hard to use ArrayBuffer
as more than a TypedArray.
SharedArrayBuffer
and ArrayBuffer
Personal interest. Maybe will be useful as shared memory primitive, and communicating with WASM. Maybe state management with shared memory across workers?
It's working! but very unoptimized (eg objects are simple linked lists), only append data (no logic to reuse unreachable memory)
and its not extending the backing arraybuffer
size by itself.
if you exceed the sb size, an exception will be thrown.
ArrayBuffer.prototype.transfer is still not supported anywhere, so we can't do that efficiently anyhow
JSON.stringify
Date
Map
Set
bigint
bigger than 64 bitJSON.stringify
Symbol
There's a huge place for optimizations, code hygiene, and features!
Feel free to open issues and maybe implementing missing parts
FAQs
Object-like api, backed by an array buffer
The npm package @bnaya/objectbuffer receives a total of 17 weekly downloads. As such, @bnaya/objectbuffer popularity was classified as not popular.
We found that @bnaya/objectbuffer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.