{
"_from": "infer-owner@1.0.4",
"_id": "infer-owner@1.0.4",
"_inBundle": false,
"_integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==",
"_location": "/npm/infer-owner",
"_phantomChildren": {},
"_requested": {
"escapedName": "infer-owner",
"fetchSpec": "1.0.4",
"name": "infer-owner",
"raw": "infer-owner@1.0.4",
"rawSpec": "1.0.4",
"registry": true,
"saveSpec": null,
"type": "version"
},
"_requiredBy": [
"#USER",
"/npm",
"/npm/cacache",
"/npm/gentle-fs",
"/npm/pacote"
],
"_resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
"_shasum": "c4cefcaa8e51051c2a40ba2ce8a3d27295af9467",
"_shrinkwrap": null,
"_spec": "infer-owner@1.0.4",
"_where": "/Users/isaacs/dev/npm/cli",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
"url": "https://izs.me"
},
"bugs": {
"url": "https://github.com/npm/infer-owner/issues"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "Infer the owner of a path based on the owner of its nearest existing parent",
"devDependencies": {
"mutate-fs": "^2.1.1",
"tap": "^12.4.2"
},
"files": [
"index.js"
],
"homepage": "https://github.com/npm/infer-owner#readme",
"license": "ISC",
"main": "index.js",
"name": "infer-owner",
"optionalDependencies": {},
"publishConfig": {
"access": "public"
},
"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",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/infer-owner.git"
},
"scripts": {
"postpublish": "git push origin --follow-tags",
"postversion": "npm publish",
"preversion": "npm test",
"snap": "TAP_SNAPSHOT=1 tap -J test/*.js --100",
"test": "tap -J test/*.js --100"
},
"version": "1.0.4"
}