MCPcopy Create free account
hub / github.com/browsemake/browser-cli / getRunningPid

Function getRunningPid

bin/br.js:11–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const PORT = 3030;
10
11function getRunningPid() {
12 try {
13 const pid = parseInt(fs.readFileSync(PID_FILE, 'utf8'), 10);
14 process.kill(pid, 0);
15 return pid;
16 } catch (err) {
17 return null;
18 }
19}
20
21function send(path, method = 'GET', body) {
22 return new Promise((resolve, reject) => {

Callers 1

br.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected