@zimtsui/lock-pid-file
v0.0.4
Published
[![Npm package version](https://flat.badgen.net/npm/v/@zimtsui/lock-pid-file)](https://www.npmjs.com/package/@zimtsui/lock-pid-file)
Downloads
3
Readme
lock-pid-file
This function creates a .pid
file in XDG_RUNTIME_DIR with the process ID written into it, and sets a POSIX Advisory Record Lock on the entire file.
If the file is already locked by any other processes, it throws.
Examples
import { lockPidFile } from 'lock-pid-file';
lockPidFile('app-name-in-kebab-case');