{"_id":"walk-up-path","_rev":"3343523","name":"walk-up-path","description":"Given a path string, return a generator that walks up the path, emitting each dirname.","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"isaacs","email":""}],"time":{"modified":"2024-07-15T01:57:57.000Z","created":"2020-05-24T21:36:06.164Z","4.0.0":"2024-07-08T22:41:10.395Z","3.0.1":"2023-04-10T06:01:05.040Z","3.0.0":"2023-04-09T22:56:45.621Z","2.0.0":"2023-04-05T22:18:16.886Z","1.0.0":"2020-05-24T21:36:06.164Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"versions":{"4.0.0":{"name":"walk-up-path","version":"4.0.0","description":"Given a path string, return a generator that walks up the path, emitting each dirname.","repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tshy","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","format":"prettier --write . --log-level warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts"},"prettier":{"experimentalTernaries":true,"semi":false,"printWidth":75,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"devDependencies":{"@types/node":"^20.14.10","prettier":"^3.3.2","tap":"^20.0.3","tshy":"^3.0.0","typedoc":"^0.26.3"},"type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":"20 || >=22"},"_id":"walk-up-path@4.0.0","gitHead":"9fce3998c6924f2749c077122f24ebf4a7e45d7d","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"homepage":"https://github.com/isaacs/walk-up-path#readme","_nodeVersion":"20.13.1","_npmVersion":"10.7.0","dist":{"shasum":"590666dcf8146e2d72318164f1f2ac6ef51d4198","size":2495,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/walk-up-path/download/walk-up-path-4.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_4.0.0_1720478470270_0.3933273677222011"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-08T22:41:10.395Z","publish_time":1720478470395,"_source_registry_name":"default","_cnpm_publish_time":1720478470395},"3.0.1":{"name":"walk-up-path","version":"3.0.1","main":"./dist/cjs/index.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{".":{"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"},"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"}}},"description":"Given a path string, return a generator that walks up the path, emitting each dirname.","repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","format":"prettier --write . --loglevel warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts"},"prettier":{"semi":false,"printWidth":75,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--no-warnings","--loader","ts-node/esm"],"ts":false},"devDependencies":{"@types/node":"^18.15.5","@types/tap":"^15.0.8","c8":"^7.13.0","eslint-config-prettier":"^8.8.0","prettier":"^2.8.6","tap":"^16.3.4","ts-node":"^10.9.1","typedoc":"^0.23.28","typescript":"^5.0.2"},"gitHead":"b79594a6a28a8809960673d6a6e9ae78b4c12309","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"homepage":"https://github.com/isaacs/walk-up-path#readme","_id":"walk-up-path@3.0.1","_nodeVersion":"18.14.0","_npmVersion":"9.6.4","dist":{"shasum":"c8d78d5375b4966c717eb17ada73dbd41490e886","size":2492,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/walk-up-path/download/walk-up-path-3.0.1.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_3.0.1_1681106464889_0.17352355251426066"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-10T06:01:05.040Z","publish_time":1681106465040,"_cnpm_publish_time":1681106465040},"3.0.0":{"name":"walk-up-path","version":"3.0.0","main":"./dist/cjs/index.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{".":{"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"},"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"}}},"description":"Given a path string, return a generator that walks up the path, emitting each dirname.","repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","format":"prettier --write . --loglevel warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts"},"prettier":{"semi":false,"printWidth":75,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--no-warnings","--loader","ts-node/esm"],"ts":false},"devDependencies":{"@types/node":"^18.15.5","@types/tap":"^15.0.8","c8":"^7.13.0","eslint-config-prettier":"^8.8.0","prettier":"^2.8.6","ts-node":"^10.9.1","typedoc":"^0.23.28","typescript":"^5.0.2"},"dependencies":{"tap":"^16.3.4"},"gitHead":"adb4618d84bb4d977740978963ca34b5b749a90b","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"homepage":"https://github.com/isaacs/walk-up-path#readme","_id":"walk-up-path@3.0.0","_nodeVersion":"18.14.0","_npmVersion":"9.6.4","dist":{"shasum":"0605acd6143072e911460f26ea6332fadebd19fe","size":2496,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/walk-up-path/download/walk-up-path-3.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_3.0.0_1681081005484_0.6097615954235422"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-09T22:56:45.621Z","publish_time":1681081005621,"_cnpm_publish_time":1681081005621},"2.0.0":{"name":"walk-up-path","version":"2.0.0","main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{".":{"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"},"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"}}},"description":"Given a path string, return a generator that walks up the path, emitting each dirname.","repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","format":"prettier --write . --loglevel warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts"},"prettier":{"semi":false,"printWidth":75,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--no-warnings","--loader","ts-node/esm"],"ts":false},"devDependencies":{"@types/node":"^18.15.5","@types/tap":"^15.0.8","c8":"^7.13.0","eslint-config-prettier":"^8.8.0","prettier":"^2.8.6","ts-node":"^10.9.1","typedoc":"^0.23.28","typescript":"^5.0.2"},"dependencies":{"tap":"^16.3.4"},"gitHead":"ae133dfb70b098d4f46af3f18ac4604ce5af37a1","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"homepage":"https://github.com/isaacs/walk-up-path#readme","_id":"walk-up-path@2.0.0","_nodeVersion":"18.14.0","_npmVersion":"9.6.3","dist":{"shasum":"d950d2ee4cf88a45da8ae38598273e69d7cdc267","size":2862,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/walk-up-path/download/walk-up-path-2.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_2.0.0_1680733096740_0.03990861087190645"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-05T22:18:16.886Z","publish_time":1680733096886,"_cnpm_publish_time":1680733096886},"1.0.0":{"name":"walk-up-path","version":"1.0.0","description":"Given a path string, return a generator that walks up the path, emitting each dirname.","repository":{"type":"git","url":"git+https://github.com/isaacs/walk-up-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.10.7","require-inject":"^1.4.4"},"gitHead":"09978d8c889823988f11f583c9b0f22bf4b66381","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"homepage":"https://github.com/isaacs/walk-up-path#readme","_id":"walk-up-path@1.0.0","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e","size":1381,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/walk-up-path/download/walk-up-path-1.0.0.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_1.0.0_1590356166014_0.1994914696104697"},"_hasShrinkwrap":false,"publish_time":1590356166164,"_cnpm_publish_time":1590356166164}},"readme":"# walk-up-path\n\nGiven a path string, return a generator that walks up the path, emitting\neach dirname.\n\nSo, to get a platform-portable walk up, instead of doing something like\nthis:\n\n```js\nfor (let p = dirname(path); p;) {\n\n  // ... do stuff ...\n\n  const pp = dirname(p)\n  if (p === pp)\n    p = null\n  else\n    p = pp\n}\n```\n\nOr this:\n\n```js\nfor (let p = dirname(path); !isRoot(p); p = dirname(p)) {\n  // ... do stuff ...\n}\n```\n\nYou can do this:\n\n```js\nconst { walkUpPath } = require('walk-up-path')\nfor (const p of walkUpPath(path)) {\n  // ... do stuff ..\n}\n```\n\n## API\n\n```js\nconst { walkUpPath } = require('walk-up-path')\n```\n\nGive the fn a string, it'll yield all the directories walking up to the\nroot.\n","_attachments":{},"homepage":"https://github.com/isaacs/walk-up-path#readme","bugs":{"url":"https://github.com/isaacs/walk-up-path/issues"},"license":"ISC"}