
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
pushState and replaceStatenpm install modoru
# or
pnpm add modoru
# or
yarn add modoru
Add the ModoruScript component to your app's root layout.
import { ModoruScript } from 'modoru';
export default function Layout({ children }) {
return (
<html>
<head>
<ModoruScript />
</head>
<body>{children}</body>
</html>
);
}
Use the isModoruRoot() function to determine if the user is at the initial page of your application.
'use client';
import { isModoruRoot } from 'modoru';
import { useRouter } from 'next/navigation';
function MyComponent() {
const router = useRouter();
return (
<div>
<button
onClick={() => {
if (isModoruRoot()) {
router.push('/');
} else {
router.back();
}
}}
>
Go Back
</button>
</div>
);
}
<ModoruScript />A React component that injects a script to intercept the History API. This component should be placed as early as possible in your application tree.
Props:
<script> element props except dangerouslySetInnerHTMLref forwardingisModoruRoot(): booleanReturns true if the user is at the root (initial) navigation state, false otherwise.
Returns: boolean
Modoru works by intercepting the browser's History API methods (pushState and replaceState) and tracking a navigation counter in the history state object using the __MODORU key.
pushState: Increments the navigation counterreplaceState: Preserves the current navigation counterThis approach allows you to track navigation depth without requiring route-level integration or framework-specific code.
FAQs
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
We found that modoru demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.