@osdlc/file-lock 0.0.1-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1 +1,11 @@
1
1
  # @osdlc/file-lock
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9f5a029: First release. Cross-process exclusive file locks for Node.js, in two shapes on one mechanism:
8
+
9
+ - A held lock: `claimLock(path, content, { isStale })` writes the content and a random token to a temp file and hard-links it into place, so the lock never exists empty. A lock the rule judges stale is taken over through a marker named from a hash of its content, so one reaper wins and a fresh lock is never deleted. `touchLock`, `updateLock` and `releaseLock` act only while the lock still holds the claim's token.
10
+ - Ready-made rules: `holderGone(pids)`, stale once no recorded pid is alive (`pidAlive`), and `untouchedFor(ms)`.
11
+ - A short critical section: `withLock(path, fn, { staleMs, timeoutMs, retryMs, isStale })` runs a synchronous `fn` holding the lock and throws `LockTimeoutError` when it stays held. Its rule is the lock's age unless `isStale` names another.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdlc/file-lock",
3
- "version": "0.0.1-stage",
3
+ "version": "0.1.0",
4
4
  "description": "Cross-process exclusive file locks for Node.js: a held lock with an owner token, a staleness rule you choose (holder process gone, untouched too long) and race-safe takeover of a stale lock, plus a short synchronous critical section built on it.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "author": "sksizer",
@@ -52,9 +52,9 @@
52
52
  "prettier": "3.9.6",
53
53
  "typescript": "~6.0.3",
54
54
  "vitest": "^5.0.5",
55
- "@osdlc/tsconfig": "^0.4.1",
55
+ "@osdlc/etag-write": "^0.3.1",
56
56
  "@osdlc/prettier-config": "^0.3.1",
57
- "@osdlc/etag-write": "^0.3.0"
57
+ "@osdlc/tsconfig": "^0.4.1"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsc -p tsconfig.build.json",