
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
@humanwhocodes/memory
Advanced tools
If you find this useful, please consider supporting my work with a donation.
A JavaScript implementation of dynamic memory using an ArrayBuffer as the memory storage.
Warning: Very experimental right now. May or may not be useful.
npm install @humanwhocodes/memory --save
# or
yarn add @humanwhocodes/memory
Import into your Node.js project:
// CommonJS
const { Memory } = require("@humanwhocodes/memory");
// ESM
import { Memory } from "@humanwhocodes/memory";
Import into your Deno project:
import { Memory } from "https://cdn.skypack.dev/@humanwhocodes/memory?dts";
It's recommended to import the minified version to save bandwidth:
import { Memory } from "https://cdn.skypack.dev/@humanwhocodes/memory?min";
However, you can also import the unminified version for debugging purposes:
import { Memory } from "https://cdn.skypack.dev/@humanwhocodes/memory";
After importing, create a new instance of Memory and pass in an ArrayBuffer to represent your memory:
const memory = new Memory(new ArrayBuffer(64));
// allocate 4 bytes
const address = memory.allocate(4);
// address is 0 if no memory could be allocated
if (address) {
// write some data into that address - must be a typed array
memory.write(address, new Uint8Array([1, 2, 3, 4]));
// read the data back out - returns a Uint8Array
const data = memory.read(address);
// free up the mory
memory.free(address);
} else {
console.error("Could not allocate memory.");
}
The Memory class provides safeguards to ensure you aren't accidentally writing or reading data where you shouldn't:
allocate() returns 0 when no more memory can be allocated, allowing you to handle out-of-memory issues gracefully.write() throws an error when:
0.read() throws an error if you attempt to read from an invalid address.free() throws an error if you attempt to free an invalid address.All of this is to say, it should be difficult to accidentally overwrite memory locations.
npm install to setup dependenciesnpm test to run testsApache 2.0
FAQs
A library for working with ArrayBuffer as raw memory.
We found that @humanwhocodes/memory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.