
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
@saasquatch/universal-hooks
Advanced tools
An interface and a swappable implementation that can be used to implement universal custom hooks on top of hooks.
This library aims to provide a common interface for React-like hooks to plug into. Simply plug in an implementation and your hooks are reusable across different implementations.
There are two ways to plug in an implementation. You can supply a module at runtime or you can replace Universal Hooks at compile time.
// Set an implementation for the hooks
setImplementation(haunted)
// OR
setImplementation(React)
// OR
setImplementation(Preact)
// Use the hooks like normal
function useCounter() {
const [counter, setCounter] = useState(0);
const increment = () => setCounter((c) => c + 1)
const decrement = () => setCounter((c) => c - 1)
return {counter, increment, decrement}
}
Rollup, Webpack and other bundlers allow compile-time replacement of implementations.
E.g. with the Rollup alias plugin https://github.com/rollup/plugins/tree/master/packages/alias
To swap in React
entries: [
{ find: '@saasquatch/universal-hooks', replacement: 'React' },
];
To swap in Haunted
entries: [
{ find: '@saasquatch/universal-hooks', replacement: 'haunted' },
];
Most common hooks are supported, except for useContext.
FAQs
An interface and a swappable implementation that can be used to implement universal custom hooks on top of hooks.
We found that @saasquatch/universal-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.