package.json 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. "name": "lockfile",
  3. "version": "1.0.0",
  4. "main": "lockfile.js",
  5. "directories": {
  6. "test": "test"
  7. },
  8. "dependencies": {},
  9. "devDependencies": {
  10. "tap": "~0.2.5",
  11. "touch": "0"
  12. },
  13. "scripts": {
  14. "test": "tap test/*.js"
  15. },
  16. "repository": {
  17. "type": "git",
  18. "url": "git://github.com/isaacs/lockfile"
  19. },
  20. "keywords": [
  21. "lockfile",
  22. "lock",
  23. "file",
  24. "fs",
  25. "O_EXCL"
  26. ],
  27. "author": {
  28. "name": "Isaac Z. Schlueter",
  29. "email": "i@izs.me",
  30. "url": "http://blog.izs.me/"
  31. },
  32. "license": "BSD",
  33. "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.",
  34. "readme": "# lockfile\n\nA very polite lock file utility, which endeavors to not litter, and to\nwait patiently for others.\n\n## Usage\n\n```javascript\nvar lockFile = require('lockfile')\n\n// opts is optional, and defaults to {}\nlockFile.lock('some-file.lock', opts, function (er) {\n // if the er happens, then it failed to acquire a lock.\n // if there was not an error, then the file was created,\n // and won't be deleted until we unlock it.\n\n // do my stuff, free of interruptions\n // then, some time later, do:\n lockFile.unlock('some-file.lock', function (er) {\n // er means that an error happened, and is probably bad.\n })\n})\n```\n\n## Methods\n\nSync methods return the value/throw the error, others don't. Standard\nnode fs stuff.\n\nAll known locks are removed when the process exits. Of course, it's\npossible for certain types of failures to cause this to fail, but a best\neffort is made to not be a litterbug.\n\n### lockFile.lock(path, [opts], cb)\n\nAcquire a file lock on the specified path\n\n### lockFile.lockSync(path, [opts])\n\nAcquire a file lock on the specified path\n\n### lockFile.unlock(path, cb)\n\nClose and unlink the lockfile.\n\n### lockFile.unlockSync(path)\n\nClose and unlink the lockfile.\n\n### lockFile.check(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nReturns boolean.\n\n### lockFile.checkSync(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nCallback is called with `cb(error, isLocked)`.\n\n## Options\n\n### opts.wait\n\nA number of milliseconds to wait for locks to expire before giving up.\nOnly used by lockFile.lock. Poll for `opts.wait` ms. If the lock is\nnot cleared by the time the wait expires, then it returns with the\noriginal error.\n\n### opts.pollPeriod\n\nWhen using `opts.wait`, this is the period in ms in which it polls to\ncheck if the lock has expired. Defaults to `100`.\n\n### opts.stale\n\nA number of milliseconds before locks are considered to have expired.\n\n### opts.retries\n\nUsed by lock and lockSync. Retry `n` number of times before giving up.\n\n### opts.retryWait\n\nUsed by lock. Wait `n` milliseconds before retrying.\n",
  35. "readmeFilename": "README.md",
  36. "bugs": {
  37. "url": "https://github.com/isaacs/lockfile/issues"
  38. },
  39. "homepage": "https://github.com/isaacs/lockfile",
  40. "_id": "lockfile@1.0.0",
  41. "_shasum": "b3a7609dda6012060083bacb0ab0ecbca58e9203",
  42. "_from": "lockfile@~1.0.0",
  43. "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz"
  44. }