{"_id":"common-ancestor-path","_rev":"60481","name":"common-ancestor-path","description":"Find the common ancestor of 2 or more paths on Windows or Unix","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"isaacs","email":""}],"time":{"modified":"2022-10-18T09:48:55.000Z","created":"2020-05-25T03:39:53.979Z","1.0.1":"2020-05-25T03:40:43.934Z","1.0.0":"2020-05-25T03:39:53.979Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"repository":{"type":"git","url":"git+https://github.com/isaacs/common-ancestor-path.git"},"versions":{"1.0.1":{"name":"common-ancestor-path","version":"1.0.1","description":"Find the common ancestor of 2 or more paths on Windows or Unix","repository":{"type":"git","url":"git+https://github.com/isaacs/common-ancestor-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":{"require-inject":"^1.4.4","tap":"^14.10.7"},"gitHead":"0bf875bd22a01c40364a8f9fb185c78cf27d0fb0","bugs":{"url":"https://github.com/isaacs/common-ancestor-path/issues"},"homepage":"https://github.com/isaacs/common-ancestor-path#readme","_id":"common-ancestor-path@1.0.1","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"4f7d2d1394d91b7abdf51871c62f71eadb0182a7","size":1554,"noattachment":false,"key":"/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/common-ancestor-path/download/common-ancestor-path-1.0.1.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/common-ancestor-path_1.0.1_1590378043809_0.2920039523218916"},"_hasShrinkwrap":false,"publish_time":1590378043934,"_cnpm_publish_time":1590378043934},"1.0.0":{"name":"common-ancestor-path","version":"1.0.0","description":"Find the common ancestor of 2 or more paths on Windows or Unix","repository":{"type":"git","url":"git+https://github.com/isaacs/common-ancestor-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":{"require-inject":"^1.4.4","tap":"^14.10.7"},"gitHead":"ab5ca4e6d7c3bb9873cdeb6c5ad1634b5333dc79","bugs":{"url":"https://github.com/isaacs/common-ancestor-path/issues"},"homepage":"https://github.com/isaacs/common-ancestor-path#readme","_id":"common-ancestor-path@1.0.0","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"c588649948673929b3252abecb4d4c58dd668f44","size":1287,"noattachment":false,"key":"/common-ancestor-path/-/common-ancestor-path-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/common-ancestor-path/download/common-ancestor-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/common-ancestor-path_1.0.0_1590377993830_0.34272591981278255"},"_hasShrinkwrap":false,"publish_time":1590377993979,"_cnpm_publish_time":1590377993979}},"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```js\nconst ancestor = require('common-ancestor-path')\n\n// output /a/b\nconsole.log(ancestor('/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(ancestor('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(ancestor('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","_attachments":{},"homepage":"https://github.com/isaacs/common-ancestor-path#readme","bugs":{"url":"https://github.com/isaacs/common-ancestor-path/issues"},"license":"ISC"}