{"name":"common-ancestor-path","version":"2.0.0","description":"Find the common ancestor of 2 or more paths on Windows or Unix","repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/common-ancestor-path.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"BlueOak-1.0.0","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 --cache","typedoc":"typedoc"},"devDependencies":{"@types/node":"^24.10.1","prettier":"^3.6.2","require-inject":"^1.4.4","tap":"^21.1.6","tshy":"^3.1.0","typedoc":"^0.28.14"},"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":">= 18"},"gitHead":"a25a6001e0422a97fb34afaab01d8f20f6536566","_id":"common-ancestor-path@2.0.0","bugs":{"url":"https://github.com/isaacs/common-ancestor-path/issues"},"homepage":"https://github.com/isaacs/common-ancestor-path#readme","_nodeVersion":"24.4.1","_npmVersion":"11.6.3","dist":{"integrity":"sha512-dnN3ibLeoRf2HNC+OlCiNc5d2zxbLJXOtiZUudNFSXZrNSydxcCsSpRzXwfu7BBWCIfHPw+xTayeBvJCP/D8Ng==","shasum":"f1d361aea9236aad5b92a0ff5b9df1422dd360ff","tarball":"http://registry-npm.ywwl.com/common-ancestor-path/download/common-ancestor-path-2.0.0.tgz","fileCount":13,"unpackedSize":9161,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIETfrJss7EycLgE3XzyOCCIijLtROdagF8BZ4NBY4FtoAiB9PjdWOCZ1VddpadGLyTydXoW7PV8oxkZ8SE56dhKXCQ=="}],"size":3045,"noattachment":false,"key":"/common-ancestor-path/-/common-ancestor-path-2.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/common-ancestor-path_2.0.0_1764047214737_0.46639421557017613"},"_hasShrinkwrap":false,"readme":"# common-ancestor-path\n\nFind the common ancestor of 2 or more paths on Windows or Unix\n\n## USAGE\n\nGive it two or more path strings, and it'll do the thing.\n\n```ts\nimport { commonAncestorPath } from 'common-ancestor-path'\n// or:\n// const { commonAncestorPath } = require('common-ancestor-path')\n\n// output /a/b\nconsole.log(commonAncestorPath('/a/b/c/d', '/a/b/x/y/z', '/a/b/c/i/j/k'))\n\n// normalizes separators, but NOT cases, since it matters sometimes\nconsole.log(commonAncestorPath('C:\\\\a\\\\b\\\\c', 'C:\\\\a\\\\b\\\\x'))\n\n// no common ancestor on different windows drive letters\n// so, this returns null\nconsole.log(commonAncestorPath('c:\\\\a\\\\b\\\\c', 'd:\\\\d\\\\e\\\\f'))\n```\n\n## API\n\n`commonAncestorPath(...paths)`\n\nReturns the nearest (deepest) common ancestor path, or `null` if on\ndifferent roots on Windows.\n","publish_time":1764047214935,"_cnpm_publish_time":1764047214935,"dist-tags":{"latest":"2.0.0"}}