UNPKG

@bluecadet/launchpad-cli

Version:
21 lines 814 B
export const isDetached = process.env.LAUNCHPAD_IS_DETACHED === "1"; let sentReady = false; export function forwardLog(level, payload) { if (isDetached && process.send && !sentReady) { // If detached, send log messages back to parent process via IPC process.send?.({ type: "log", level, payload }); } } export function sendReadyMessage() { if (isDetached && process.send && !sentReady) { process.send({ type: "ready" }); sentReady = true; } } export function isValidChildLogMessage(obj) { return typeof obj === "object" && obj !== null && "type" in obj && obj.type === "log"; } export function isValidReadyMessage(obj) { return typeof obj === "object" && obj !== null && "type" in obj && obj.type === "ready"; } //# sourceMappingURL=detached-messaging.js.map