UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

16 lines (15 loc) 465 B
import { relinka } from "@reliverse/relinka"; import { readPackageJSON } from "pkg-types"; export async function checkScriptExists(projectPath, scriptName) { try { const packageJson = await readPackageJSON(projectPath); return !!packageJson?.scripts?.[scriptName]; } catch (error) { relinka( "error", `Error checking for script ${scriptName}:`, error instanceof Error ? error.message : String(error) ); return false; } }