
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.
@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.

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.