@hyrious/blivec
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -28,3 +28,4 @@ #!/usr/bin/env node | ||
} | ||
function listen(id) { | ||
function listen(id, cleanup = () => { | ||
}) { | ||
function is_object(a) { | ||
@@ -53,4 +54,6 @@ return typeof a === "object" && a !== null; | ||
con.close(); | ||
cleanup(); | ||
} | ||
}); | ||
return con; | ||
} | ||
@@ -122,4 +125,6 @@ function send(id, message) { | ||
]; | ||
cp.spawnSync("ffplay", cmds, { stdio: "inherit" }); | ||
const child = cp.spawn("ffplay", cmds, { stdio: "inherit" }); | ||
const con = listen(id, () => child.kill("SIGTERM")); | ||
child.once("exit", () => con.close()); | ||
} | ||
} |
{ | ||
"name": "@hyrious/blivec", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "bilibili live cli", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -31,3 +31,3 @@ #!/usr/bin/env node | ||
function listen(id: number) { | ||
function listen(id: number, cleanup = () => {}) { | ||
function is_object(a: any) { | ||
@@ -60,4 +60,7 @@ return typeof a === "object" && a !== null; | ||
con.close(); | ||
cleanup(); | ||
} | ||
}); | ||
return con; | ||
} | ||
@@ -138,4 +141,6 @@ | ||
]; | ||
cp.spawnSync("ffplay", cmds, { stdio: "inherit" }); | ||
const child = cp.spawn("ffplay", cmds, { stdio: "inherit" }); | ||
const con = listen(id, () => child.kill("SIGTERM")); | ||
child.once("exit", () => con.close()); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38754
1114