
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Clojure's Atom implementation in JavaScript.
From the Clojure docs:
Atoms provide a way to manage shared, synchronous, independent state.
On top of the above, atoms provide also validation and observation capabilities.
$ npm install atomo
Atoms are references to values that may change over time. The most basic operation on an atom is querying its current value:
var a = require("atomo");
var anAtom = a.atom(42);
anAtom.deref() === 42
// true
An atom's value can be set to another value:
anAtom.reset("foo");
anAtom.deref() === "foo"
// true
Alternatively, an atom's value can be transitioned to another value providing a function:
function increment(x) { return x + 1; }
var anAtom = a.atom(41);
anAtom.swap(increment);
anAtom.deref() === 42
// true
Atoms support validation through a validation function, and they will throw an exception whenever we try to set the atom's value to an illegal value.
function is42(x) { return x === 42 };
var anAtom = a.atom(42, {validator: is42});
anAtom.reset(43); // Error!
anAtom.swap(increment); // Error!
Atoms support adding and removing watches for listening to value changes. Watches are called with three arguments: the atom, the old value and the new value.
var anAtom = a.atom(42);
var watcher = function(theAtom, oldValue, newValue){
console.log("Atom changed from", oldValue, "to", newValue);
};
anAtom.addWatch(watcher);
anAtom.swap(increment);
// Atom changed from 42 to 43
anAtom.reset(42);
// Atom changed from 43 to 42
anAtom.removeWatch(watcher);
anAtom.swap(increment);
anAtom.reset(42);
BSD 2-clause license, Copyright 2014 - 2015 Alejandro Gómez.
FAQs
Clojure's Atom implementation in JavaScript
We found that atomo 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.