https://github.com/allnulled/process-semaphore
In one line, it kills the process that previously executed that code, if it is still alive.
https://github.com/allnulled/process-semaphore
Last synced: 8 months ago
JSON representation
In one line, it kills the process that previously executed that code, if it is still alive.
- Host: GitHub
- URL: https://github.com/allnulled/process-semaphore
- Owner: allnulled
- Created: 2024-12-17T10:54:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-17T10:58:10.000Z (over 1 year ago)
- Last Synced: 2025-03-30T05:32:56.234Z (about 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# process-semaphore
In one line, it kills the process that previously executed that code, if it is still alive.
## Installation
```sh
npm i -s @allnulled/process-semaphore
```
## API Usage
```js
require("@allnulled/process-semaphore").create("pid.json").renew(false);
```
With this line, you will avoid the error of:
```
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (node:net:1751:16)
at listenInCluster (node:net:1799:12)
at Server.listen (node:net:1887:7)
```