Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@reactively/decorate
Advanced tools
Reactively is a library for fine grained reactive programming.
See documentation for details.
This part of the library (@reactively/decorate
)
contains annotations for using reactively in classes.
/* A lightweight reactive program can look almost like regular javascript programming.
*
* This example uses a class, with a few @reactive annotations added.
* (Reactively can be used without classes too)
*
* Here's the dataflow relationship between the reactive parts:
* size -> bufferBlocks -> buffer
*/
class ResizeableBuffer extends HasReactive {
@reactively size = 0;
@reactively get blocks() { return Math.ceil(this.size / 2 ** 12); }
@reactively get buffer(): any {
const newBuf = Buffer.allocUnsafe(this.blocks * 2 ** 12);
this._buf && newBuf.copy(this._buf);
return (this._buf = newBuf);
}
private _buf: any;
}
const b = new ResizeableBuffer();
b.size = 10 ** 5;
/* Here we call buffer() twice. In an imperative system we'd allocate twice
* which is inefficient. A reactive system will allocate only once. */
b.buffer.fill(-1);
b.buffer.setAt(0, 100);
/* A reactive system can find other efficiencies. Here's one example: */
b.size += 1; // grow the number of elements, but blocks doesn't change
b.buffer; // no new buffer allocated here!
FAQs
Reactively is a library for fine grained reactive programming.
We found that @reactively/decorate demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.