���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.1
/
nitropack
/
dist
/
chunks
/
Viewing: task.mjs
import { existsSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import { resolve } from 'pathe'; import { ofetch } from 'ofetch'; async function runTask(taskEvent, opts) { const ctx = await _getTasksContext(opts); const result = await ctx.devFetch(`/_nitro/tasks/${taskEvent.name}`, { method: "POST", body: taskEvent }); return result; } async function listTasks(opts) { const ctx = await _getTasksContext(opts); const res = await ctx.devFetch("/_nitro/tasks"); return res.tasks; } const _devHint = `(is dev server running?)`; async function _getTasksContext(opts) { const cwd = resolve(process.cwd(), opts.cwd); const outDir = resolve(cwd, opts.buildDir || ".nitro"); const buildInfoPath = resolve(outDir, "nitro.json"); if (!existsSync(buildInfoPath)) { throw new Error(`Missing info file: \`${buildInfoPath}\` ${_devHint}`); } const buildInfo = JSON.parse( await readFile(buildInfoPath, "utf8") ); if (!buildInfo.dev?.pid || !buildInfo.dev?.workerAddress) { throw new Error( `Missing dev server info in: \`${buildInfoPath}\` ${_devHint}` ); } if (!_pidIsRunning(buildInfo.dev.pid)) { throw new Error(`Dev server is not running (pid: ${buildInfo.dev.pid})`); } const devFetch = ofetch.create({ baseURL: `http://${buildInfo.dev.workerAddress.host || "localhost"}:${buildInfo.dev.workerAddress.port || "3000"}`, // @ts-expect-error socketPath: buildInfo.dev.workerAddress.socketPath }); return { buildInfo, devFetch }; } function _pidIsRunning(pid) { try { process.kill(pid, 0); return true; } catch { return false; } } export { listTasks as l, runTask as r };
Coded With 💗 by
0x6ick Mod By V1rus_Alfa