{"_id":"infer-owner","_rev":"37850","name":"infer-owner","description":"Infer the owner of a path based on the owner of its nearest existing parent","dist-tags":{"latest":"1.0.4"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"isaacs","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"time":{"modified":"2021-06-03T10:10:39.000Z","created":"2019-07-19T23:08:51.367Z","1.0.4":"2019-07-19T23:13:07.339Z","1.0.3":"2019-07-19T23:08:51.367Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"repository":{"type":"git","url":"git+https://github.com/npm/infer-owner.git"},"versions":{"1.0.4":{"name":"infer-owner","version":"1.0.4","description":"Infer the owner of a path based on the owner of its nearest existing parent","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap -J test/*.js --100","snap":"TAP_SNAPSHOT=1 tap -J test/*.js --100","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"devDependencies":{"mutate-fs":"^2.1.1","tap":"^12.4.2"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/npm/infer-owner.git"},"publishConfig":{"access":"public"},"gitHead":"264706f28c1bd50c83ecee87e3ff794bf75478f2","bugs":{"url":"https://github.com/npm/infer-owner/issues"},"homepage":"https://github.com/npm/infer-owner#readme","_id":"infer-owner@1.0.4","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"c4cefcaa8e51051c2a40ba2ce8a3d27295af9467","size":2062,"noattachment":false,"key":"/infer-owner/-/infer-owner-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/infer-owner/download/infer-owner-1.0.4.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"isaacs","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/infer-owner_1.0.4_1563577987148_0.9732602885812718"},"_hasShrinkwrap":false,"publish_time":1563577987339,"_cnpm_publish_time":1563577987339},"1.0.3":{"name":"infer-owner","version":"1.0.3","description":"Infer the owner of a path based on the owner of its nearest existing parent","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap -J test/*.js --100","snap":"TAP_SNAPSHOT=1 tap -J test/*.js --100","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"devDependencies":{"mutate-fs":"^2.1.1","tap":"^12.4.2"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/npm/infer-owner.git"},"publishConfig":{"access":"public"},"gitHead":"0d0729db142c6401963e97a136c7d29ecc55746a","bugs":{"url":"https://github.com/npm/infer-owner/issues"},"homepage":"https://github.com/npm/infer-owner#readme","_id":"infer-owner@1.0.3","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"38d030afce90f1759c16b783e841522cb8995656","size":24020,"noattachment":false,"key":"/infer-owner/-/infer-owner-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/infer-owner/download/infer-owner-1.0.3.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"isaacs","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/infer-owner_1.0.3_1563577731234_0.6947691890893826"},"_hasShrinkwrap":false,"publish_time":1563577731367,"_cnpm_publish_time":1563577731367}},"readme":"# infer-owner\n\nInfer the owner of a path based on the owner of its nearest existing parent\n\n## USAGE\n\n```js\nconst inferOwner = require('infer-owner')\n\ninferOwner('/some/cache/folder/file').then(owner => {\n  // owner is {uid, gid} that should be attached to\n  // the /some/cache/folder/file, based on ownership\n  // of /some/cache/folder, /some/cache, /some, or /,\n  // whichever is the first to exist\n})\n\n// same, but not async\nconst owner = inferOwner.sync('/some/cache/folder/file')\n\n// results are cached!  to reset the cache (eg, to change\n// permissions for whatever reason), do this:\ninferOwner.clearCache()\n```\n\nThis module endeavors to be as performant as possible.  Parallel requests\nfor ownership of the same path will only stat the directories one time.\n\n## API\n\n* `inferOwner(path) -> Promise<{ uid, gid }>`\n\n    If the path exists, return its uid and gid.  If it does not, look to\n    its parent, then its grandparent, and so on.\n\n* `inferOwner(path) -> { uid, gid }`\n\n    Sync form of `inferOwner(path)`.\n\n* `inferOwner.clearCache()`\n\n    Delete all cached ownership information and in-flight tracking.\n","_attachments":{},"homepage":"https://github.com/npm/infer-owner#readme","bugs":{"url":"https://github.com/npm/infer-owner/issues"},"license":"ISC"}