{"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":{"integrity":"sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==","shasum":"590666dcf8146e2d72318164f1f2ac6ef51d4198","tarball":"http://registry-npm.ywwl.com/walk-up-path/download/walk-up-path-4.0.0.tgz","fileCount":13,"unpackedSize":6063,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD84Waej+pde2L1K2w8Z3ZrUZ7UKzDnbybX45cnGG45eQIgM+v/Uot+vlwi51t/l4EI1M9dJLZxfrGyD8Wp6oMJJUE="}],"size":2495,"noattachment":false,"key":"/walk-up-path/-/walk-up-path-4.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/walk-up-path_4.0.0_1720478470270_0.3933273677222011"},"_hasShrinkwrap":false,"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","publish_time":1720478470395,"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_cnpm_publish_time":1720478470395,"dist-tags":{"latest":"4.0.0"}}