
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.
previewcron
Advanced tools
Test Vercel cron jobs locally in your Next.js development environment with a simple UI.
vercel.json from your projectnpm install previewcron --save-dev
# or
bun add -d previewcron
# or
yarn add -D previewcron
You can place this anywhere in your Next.js app. Common locations:
// app/dev/cron/page.tsx
// OR app/admin/cron-test/page.tsx
export { default } from "previewcron/page";
Add the CSS import to your layout or page:
// app/dev/cron/layout.tsx (recommended)
import "previewcron/styles.css";
export default function Layout({ children }: { children: React.ReactNode }) {
return children;
}
Or import directly in your page:
// app/dev/cron/page.tsx
import "previewcron/styles.css";
export { default } from "previewcron/page";
vercel.json file{
"crons": [
{
"path": "/api/cron/cleanup",
"schedule": "0 0 0 0 0"
}
]
}
npm run dev
Then navigate to the route you created (e.g., http://localhost:3000/dev/cron)
That's it! You'll see all your cron jobs listed and can test them with a single click.
The dashboard includes an optional Authorization header input. This is useful for testing cron endpoints that require authentication:
Bearer YOUR_SECRET_TOKEN)If your dev server runs on a different port:
// app/dev/cron/page.tsx
import CronDevPage from "previewcron/page";
export default function Page() {
return <CronDevPage baseUrl="http://localhost:4000" />;
}
If your vercel.json is in a different location:
import CronDevPage from "previewcron/page";
export default function Page() {
return <CronDevPage vercelJsonPath="./config/vercel.json" />;
}
Instead of reading from a file, you can pass the config directly:
import CronDevPage from "previewcron/page";
export default function Page() {
return (
<CronDevPage
config={{
crons: [
{
path: "/api/cron/test",
schedule: "* * * * *",
},
],
}}
/>
);
}
For more control, you can use the individual components:
"use client";
import { CronDashboard } from "previewcron/client";
import "previewcron/styles.css";
import type { VercelCron } from "previewcron";
export default function CustomCronPage() {
const crons: VercelCron[] = [
{ path: "/api/cron/test", schedule: "0 0 * * *" },
];
return <CronDashboard crons={crons} baseUrl="http://localhost:3000" />;
}
CronDevPage (Default Export)Server Component that reads vercel.json and renders the dashboard.
Props:
vercelJsonPath?: string - Custom path to vercel.json filebaseUrl?: string - Base URL for cron jobs (default: http://localhost:3000)config?: VercelConfig - Inline config instead of reading from fileCronDashboard (Client Component)Client Component for rendering the dashboard.
Props:
crons: VercelCron[] - Array of cron jobsbaseUrl: string - Base URL for making requestsimport { readVercelJson } from 'previewcron/server';
const result = await readVercelJson({
path: './vercel.json', // optional
baseUrl: 'http://localhost:3000', // optional
config: { crons: [...] }, // optional inline config
});
import type { VercelCron, VercelConfig, CronJobWithStatus } from "previewcron";
import { parseCronSchedule } from "previewcron";
const readable = parseCronSchedule("0 0 * * *"); // "At 12:00 AM"
This package is designed for development use only. The dashboard:
NODE_ENV === 'development'Never expose the cron testing dashboard in production environments.
The package includes its own vanilla CSS stylesheet that works without Tailwind or any other CSS framework. The styles:
prefers-color-scheme).previewcron-root to avoid conflictsImport the styles in your layout or page:
import "previewcron/styles.css";
vercel.json file (server-side)localhost with this package{
"crons": [
{
"path": "/api/cron/cleanup",
"schedule": "0 0 * * *"
}
]
}
// app/api/cron/cleanup/route.ts
export async function GET() {
// Your cleanup logic
await cleanupOldData();
return Response.json({ success: true, message: "Cleanup completed" });
}
Now you can test this endpoint instantly from the dashboard instead of waiting for the schedule or manually visiting the URL!
MIT
Ludovic Gueth
FAQs
Test Vercel cron jobs locally with a simple UI
We found that previewcron 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.

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.