{
  "_id": "common-ancestor-path",
  "maintainers": [
    {
      "name": "isaacs",
      "email": "i@izs.me"
    }
  ],
  "dist-tags": {
    "latest": "2.0.0"
  },
  "author": {
    "name": "Isaac Z. Schlueter",
    "email": "i@izs.me",
    "url": "https://izs.me"
  },
  "_rev": "4-08f96aa377f6bcc8e2269574bfa8e01a",
  "description": "Find the common ancestor of 2 or more paths on Windows or Unix",
  "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",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/isaacs/common-ancestor-path.git"
  },
  "bugs": {
    "url": "https://github.com/isaacs/common-ancestor-path/issues"
  },
  "license": "BlueOak-1.0.0",
  "versions": {
    "1.0.0": {
      "name": "common-ancestor-path",
      "version": "1.0.0",
      "author": {
        "url": "https://izs.me",
        "name": "Isaac Z. Schlueter",
        "email": "i@izs.me"
      },
      "license": "ISC",
      "_id": "common-ancestor-path@1.0.0",
      "maintainers": [
        {
          "name": "isaacs",
          "email": "i@izs.me"
        }
      ],
      "homepage": "https://github.com/isaacs/common-ancestor-path#readme",
      "bugs": {
        "url": "https://github.com/isaacs/common-ancestor-path/issues"
      },
      "tap": {
        "check-coverage": true
      },
      "dist": {
        "shasum": "c588649948673929b3252abecb4d4c58dd668f44",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/common-ancestor-path/-/common-ancestor-path-1.0.0.tgz",
        "fileCount": 3,
        "integrity": "sha512-E2lb9X0KxPLX48ZY+bqErM7H71UnR8f+4eTTbvTlktfp5XKlkVIjfgX2hAlMjCJFPT6txGGsYpJoEa4Kk24hNg==",
        "signatures": [
          {
            "sig": "MEUCIQDW+juldPuIw67dUvytyBJcDQWismI/0466hRJa+YG0AAIgXdBz6boUPgxRpy+Yh+j7n9Bo7hr1iF366iBMfItasZ4=",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ],
        "unpackedSize": 2098,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyz4KCRA9TVsSAnZWagAAfE0P/i/3UnI1g/gLJWKSBpuW\n1isJpotsCe+5H9uCocUBdb2JxgdAkWI4SKigUzoAejhljVoA0RcenAmIdbyx\nZno/PsOfQ59O3mxgNeBAQ5fueFrrmYtshQaF9cJoUfX0uiBXZeYmBal5rlnM\nxrFu+c674gks0duAE5Y4VIZy4NH0XH08lcXUOvxKv4hdrTtfLGEl5rC4+E3s\nsvXm582uInM+4zrX1rLVTsDMIOmpaZTAZIMuyFaso3a0WbPC4WClPNRWWfPO\nuh2P7p3nV3RzAoVC6KchL6Ty2rM/xcXl7v0Tx4ki/vrI6y5QQm19+Zk7R+k6\nJwhXI88y09tUU4CgErbNgBTFpTS01uRMfpSZLgmHVlK1lz/j0Pn2kDttlCOA\ndoydGD0qAl4QredEu29jPwYa9Mc5Qwb8fvt6UfeDC+hxfVn2jtQJRpAflsa4\n04vn0vQfkz0aaVMjcNmmFeMwsFOoeVupbBA/qsQlCUk1dCOhsvvVXmxQjcug\nwbpGtq9oF55+3d0KS8zie2nFP1pTwogqFId4AAkt8Vot+ZGIO0NeKbWdLlgr\nRGbITezm7IVepr83AOYqE/oZt1Ie2a23Wp7g6+LNFNYUACVCMHPGwStWZuvG\nUOOigddPmTUARC7X0BqoqMhaiU22LUZPao6AJsEqN/0Ri5TSHDX7EIKS6wcO\n59rs\r\n=38Rf\r\n-----END PGP SIGNATURE-----\r\n"
      },
      "gitHead": "ab5ca4e6d7c3bb9873cdeb6c5ad1634b5333dc79",
      "scripts": {
        "snap": "tap",
        "test": "tap",
        "preversion": "npm test",
        "postversion": "npm publish",
        "prepublishOnly": "git push origin --follow-tags"
      },
      "_npmUser": {
        "name": "isaacs",
        "email": "i@izs.me"
      },
      "repository": {
        "url": "git+https://github.com/isaacs/common-ancestor-path.git",
        "type": "git"
      },
      "_npmVersion": "6.14.4",
      "description": "Find the common ancestor of 2 or more paths on Windows or Unix",
      "directories": {},
      "_nodeVersion": "14.2.0",
      "_hasShrinkwrap": false,
      "devDependencies": {
        "tap": "^14.10.7",
        "require-inject": "^1.4.4"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/common-ancestor-path_1.0.0_1590377993830_0.34272591981278255",
        "host": "s3://npm-registry-packages"
      }
    },
    "1.0.1": {
      "name": "common-ancestor-path",
      "version": "1.0.1",
      "author": {
        "url": "https://izs.me",
        "name": "Isaac Z. Schlueter",
        "email": "i@izs.me"
      },
      "license": "ISC",
      "_id": "common-ancestor-path@1.0.1",
      "maintainers": [
        {
          "name": "isaacs",
          "email": "i@izs.me"
        }
      ],
      "homepage": "https://github.com/isaacs/common-ancestor-path#readme",
      "bugs": {
        "url": "https://github.com/isaacs/common-ancestor-path/issues"
      },
      "tap": {
        "check-coverage": true
      },
      "dist": {
        "shasum": "4f7d2d1394d91b7abdf51871c62f71eadb0182a7",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz",
        "fileCount": 4,
        "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==",
        "signatures": [
          {
            "sig": "MEQCIDicxuhQcaPCNyeV0q68UiG+dAkPsSevtvoyfml3Fx+gAiAc9XeSHCU5sRjtoCvcaAcO7tHtTKzEtexiNp8m41QCoQ==",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ],
        "unpackedSize": 2574,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyz48CRA9TVsSAnZWagAAVJ0P/jhrixgZm6kFdLInL2C6\nYp7KQRvlDpCYvovLu4tByk77+jxaMEWWpH8+aCSJBObcottf5TemvaEnwEor\npwVqdM1G7hxB5+POz8VdbacVnCIDYjWa9sEGIn36ZYWz/jnKyeYnoB4s2DJG\nFpASqkzzFl1l/8BEMPcxf54inorRz9YC67uSf6Ijw6RYPy7nXOGR24bJ+5xK\n5BsiaSUf32ppzQcmL6zVMu+5pBcMzfXfHYBqe7Sf+OXZ+tE2ge5M6RmF0iwM\nJUWk3+A2rHTEPYUHdZoSXOj5njKQHKtvL16qirANidE8gh4ex8AQv/VlaPgx\nJZqfjujC9d39KVpwEsS2lKhCsoF5HtdlKToJo1qpT3T/mKLD6zMo5fTp4DFM\nPD8ruG8cngI1XaquYL/Sc8HN69ziqQKxbJKTkMq/QIG1QhmsjTorr/YmBbF0\nE0FYXr3zMzt70JukjvAW8lrf+XG/P1gXoypA2KN6eWvCNM67/G+1oKGTTy8R\niJFk5lJQSt5EW3RiDBKUJjPuCZgkAvHH57CaQZVj7blOGuzlwUSfmBlmxeWc\nqw93IRyLQXpkFoCksbAaJXTEbW0530a7+Dh+IjQS/OreueuOhLN5L4L3rep9\n041nr26pPsZ3QaULV/0JXaNk3ciJxyEZpMLsDhYbqnIVy+WlzuNzyGs628OP\n7I3c\r\n=2RKF\r\n-----END PGP SIGNATURE-----\r\n"
      },
      "gitHead": "0bf875bd22a01c40364a8f9fb185c78cf27d0fb0",
      "scripts": {
        "snap": "tap",
        "test": "tap",
        "preversion": "npm test",
        "postversion": "npm publish",
        "prepublishOnly": "git push origin --follow-tags"
      },
      "_npmUser": {
        "name": "isaacs",
        "email": "i@izs.me"
      },
      "repository": {
        "url": "git+https://github.com/isaacs/common-ancestor-path.git",
        "type": "git"
      },
      "_npmVersion": "6.14.4",
      "description": "Find the common ancestor of 2 or more paths on Windows or Unix",
      "directories": {},
      "_nodeVersion": "14.2.0",
      "_hasShrinkwrap": false,
      "devDependencies": {
        "tap": "^14.10.7",
        "require-inject": "^1.4.4"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/common-ancestor-path_1.0.1_1590378043809_0.2920039523218916",
        "host": "s3://npm-registry-packages"
      }
    },
    "2.0.0": {
      "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": "https://archive.ito.gov.ir/npm/_packages/common-ancestor-path/-/common-ancestor-path-2.0.0.tgz",
        "fileCount": 13,
        "unpackedSize": 9161,
        "signatures": [
          {
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
            "sig": "MEQCIETfrJss7EycLgE3XzyOCCIijLtROdagF8BZ4NBY4FtoAiB9PjdWOCZ1VddpadGLyTydXoW7PV8oxkZ8SE56dhKXCQ=="
          }
        ]
      },
      "_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
    }
  },
  "name": "common-ancestor-path",
  "time": {
    "created": "2020-05-25T03:39:53.785Z",
    "modified": "2026-06-01T22:01:35.491Z",
    "1.0.0": "2020-05-25T03:39:53.979Z",
    "1.0.1": "2020-05-25T03:40:43.934Z",
    "2.0.0": "2025-11-25T05:06:54.935Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/isaacs/common-ancestor-path#readme"
}