A bridge of flock(2) to Node.js/ShadowNode in N-API.
Alias: flock.lockAsync(path, [options]) -> Promise<lock>
path
:<string>
options.wait
:<boolean>
Default: false while lock is unavailable, if blocks current JavaScript execution context.options.exclusive
:<boolean>
Default: false if acquires exclusive lock. Defaults to shared lock.callback
:<Function>
error
:<Error>
lock
:<integer>
lock instance, currently it's a number.
Acquires the lock on the file.
Alias: flock.upgradeAsync(lock, [options]) -> Promise<lock>
lock
:<integer>
options.wait
:<boolean>
Default: false while lock is unavailable, if blocks current JavaScript execution context.options.exclusive
:<boolean>
Default: false if acquires exclusive lock. Defaults to shared lock.callback
:<Function>
error
:<Error>
lock
:<integer>
lock instance, currently it's a number.
Upgrades the lock previously acquired.
Alias: flock.unlockAsync(lock) -> Promise<void>
lock
:<integer>
callback
:<Function>
error
:<Error>
Unlocks previously acquired lock.