{
  "_id": "common-path-prefix",
  "maintainers": [
    {
      "name": "novemberborn",
      "email": "mark@novemberborn.net"
    }
  ],
  "keywords": [
    "common",
    "path",
    "directory",
    "dir",
    "file",
    "root",
    "typescript",
    "common prefix",
    "common path",
    "common path start",
    "common root"
  ],
  "dist-tags": {
    "latest": "3.0.0"
  },
  "author": {
    "name": "Mark Wubben",
    "url": "https://novemberborn.net/"
  },
  "_rev": "9-413c30cb225f48e101e7e32ba8564688",
  "description": "Computes the longest prefix string that is common to each path, excluding the base component",
  "readme": "# common-path-prefix\n\nComputes the longest prefix string that is common to each path, excluding the base component. Tested with Node.js 8 and above.\n\n## Installation\n\n```console\nnpm install common-path-prefix\n```\n\n## Usage\n\nThe module has one default export, the `commonPathPrefix` function:\n\n```js\nconst commonPathPrefix = require('common-path-prefix')\n```\n\nCall `commonPathPrefix()` with an array of paths (strings) and an optional separator character:\n\n```js\nconst paths = ['templates/main.handlebars', 'templates/_partial.handlebars']\n\ncommonPathPrefix(paths, '/') // returns 'templates/'\n```\n\nIf the separator is not provided the first `/` or `\\` found in any of the paths is used. Otherwise the platform-default value is used:\n\n```js\ncommonPathPrefix(['templates/main.handlebars', 'templates/_partial.handlebars']) // returns 'templates/'\ncommonPathPrefix(['templates\\\\main.handlebars', 'templates\\\\_partial.handlebars']) // returns 'templates\\\\'\n```\n\nYou can provide any separator, for example:\n\n```js\ncommonPathPrefix(['foo$bar', 'foo$baz'], '$') // returns 'foo$''\n```\n\nAn empty string is returned if no common prefix exists:\n\n```js\ncommonPathPrefix(['foo/bar', 'baz/qux']) // returns ''\ncommonPathPrefix(['foo/bar']) // returns ''\n```\n\nNote that the following *does* have a common prefix:\n\n```js\ncommonPathPrefix(['/foo/bar', '/baz/qux']) // returns '/'\n```\n",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/novemberborn/common-path-prefix.git"
  },
  "users": {
    "novemberborn": true,
    "kael": true,
    "flumpus-dev": true
  },
  "bugs": {
    "url": "https://github.com/novemberborn/common-path-prefix/issues"
  },
  "license": "ISC",
  "versions": {
    "1.0.0": {
      "name": "common-path-prefix",
      "version": "1.0.0",
      "description": "Computes the longest prefix string that is common to each path, excluding the base component",
      "main": "index.js",
      "files": [
        "index.js"
      ],
      "scripts": {
        "coverage": "nyc npm test",
        "test": "ava",
        "posttest": "standard"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/novemberborn/common-path-prefix.git"
      },
      "author": {
        "name": "Mark Wubben",
        "url": "https://novemberborn.net/"
      },
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/novemberborn/common-path-prefix/issues"
      },
      "homepage": "https://github.com/novemberborn/common-path-prefix#readme",
      "devDependencies": {
        "ava": "^0.9.1",
        "nyc": "^5.3.0",
        "standard": "^5.4.1"
      },
      "gitHead": "164356169afc042f691178b2731bebbbfe85499d",
      "_id": "common-path-prefix@1.0.0",
      "_shasum": "cd52f6f0712e0baab97d6f9732874f22f47752c0",
      "_from": ".",
      "_npmVersion": "3.5.3",
      "_nodeVersion": "5.4.0",
      "_npmUser": {
        "name": "novemberborn",
        "email": "mark@novemberborn.net"
      },
      "dist": {
        "shasum": "cd52f6f0712e0baab97d6f9732874f22f47752c0",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/common-path-prefix/-/common-path-prefix-1.0.0.tgz",
        "integrity": "sha512-StWMCZw9nTO+RnxMCcapnQQqeZpaDvCD9+0Rrl8ZphFKWcJPyUGiEl64WoAkA+WJIxwKYzxldhYHU+EW1fQ2mQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCICcsB+N7udzgXkBd4Yw7u6Mn8jBGWWev+B7buqRxAo+uAiA+iX/qOQgfoYJJuyX7DG+eEneR/Pqpyeg4emVvZ3bFTQ=="
          }
        ]
      },
      "maintainers": [
        {
          "name": "novemberborn",
          "email": "mark@novemberborn.net"
        }
      ],
      "directories": {}
    },
    "2.0.0": {
      "name": "common-path-prefix",
      "version": "2.0.0",
      "description": "Computes the longest prefix string that is common to each path, excluding the base component",
      "main": "index.js",
      "scripts": {
        "test": "standard && nyc ava"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/novemberborn/common-path-prefix.git"
      },
      "author": {
        "name": "Mark Wubben",
        "url": "https://novemberborn.net/"
      },
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/novemberborn/common-path-prefix/issues"
      },
      "homepage": "https://github.com/novemberborn/common-path-prefix#readme",
      "keywords": [
        "common",
        "path",
        "directory",
        "dir",
        "file",
        "root",
        "typescript",
        "common prefix",
        "common path",
        "common path start",
        "common root"
      ],
      "devDependencies": {
        "ava": "^2.3.0",
        "nyc": "^14.1.1",
        "standard": "^14.0.2"
      },
      "gitHead": "9c3b64c8f220c4c58b54d28e0c13c8eea1ec0699",
      "_id": "common-path-prefix@2.0.0",
      "_nodeVersion": "10.16.3",
      "_npmVersion": "6.11.2",
      "dist": {
        "integrity": "sha512-Lb9qbwwyQdRDmyib0qur7BC9/GHIbviTaQebayFsGC/n77AwFhZINCcJkQx2qVv9LJsA8F5ex65F2qrOfWGUyw==",
        "shasum": "25b0265f318bf093a6ec630813aac97b29dea230",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/common-path-prefix/-/common-path-prefix-2.0.0.tgz",
        "fileCount": 5,
        "unpackedSize": 3723,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZjiXCRA9TVsSAnZWagAAShsP/2M650HVEK1hkiyLNaid\nDck6bBmmSlZfjtgpYHzpqCSdRRZoO8iqkfaTSq+NFxMcXJT9wLUMavGFP8Wl\nTyfjn0La13Gguk9JR2L5vZvhut0BVkVirUJGG/QxxgNI6jJN72orOc8Q7eIZ\nxMgiTjTUzyDmz40z7Bbj3CycTyZBL26QA6VJbfGUZIi5d9geU6Q3sDMYZOI9\nfPoIpegkOhbh6fRniSPZaGpqNYkiqqPyT8YxHHG2hhcBpVVL9bmk9ke1HKOi\nD2hc14QD8KT6YmsI6liFQWYYTJYGehyM7uXvY+5sy6otQuFFMq46YRX/O/OU\nclsjiEw2umI8NEb1jgb/rK9pLhNJhMsUIwN+Q3SX4gqj5lfS6A4rBoa62N4T\njphktejJyWan9iSCSNQRIoIcrjwGm56tqrXgTR6U6qyUcvY2XoXbGy+5dmtI\nL7XAVoYxhTV8S/uTdOGz6VVXhFY87SaJlkfMHaWPqSBdl+jNyQmG7WVRJZ6d\n7A2vQXBSMc+/GbwVxhfxf0Dv4HN6rxUiKe8gQ+xw5Z23bad1GQCZsRF2AJCP\ndUDQ0k1n9E/thZKnYhxvsfWOnm47H8T9E1vFAsl/2IWwPAMgFkEvrUf8xc+A\nUtnomRIDoJiJMqqEm+CtlxQo24i03CruH5Bt6O1LYDqB03g3JuqfnNYWhZKy\n4kSx\r\n=PftD\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQC1Vp42NRqrLKiyvpk2M9eJ97lcF6RCabyxsp61G2LG6wIhANGtovRt/tURSopVFLe6DjFO2iZZMiYTDGt4Qmz8AaNX"
          }
        ]
      },
      "maintainers": [
        {
          "name": "novemberborn",
          "email": "mark@novemberborn.net"
        }
      ],
      "_npmUser": {
        "name": "novemberborn",
        "email": "mark@novemberborn.net"
      },
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/common-path-prefix_2.0.0_1566980247159_0.6050454893692394"
      },
      "_hasShrinkwrap": false
    },
    "3.0.0": {
      "name": "common-path-prefix",
      "version": "3.0.0",
      "description": "Computes the longest prefix string that is common to each path, excluding the base component",
      "main": "index.js",
      "scripts": {
        "test": "standard && nyc ava"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/novemberborn/common-path-prefix.git"
      },
      "author": {
        "name": "Mark Wubben",
        "url": "https://novemberborn.net/"
      },
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/novemberborn/common-path-prefix/issues"
      },
      "homepage": "https://github.com/novemberborn/common-path-prefix#readme",
      "keywords": [
        "common",
        "path",
        "directory",
        "dir",
        "file",
        "root",
        "typescript",
        "common prefix",
        "common path",
        "common path start",
        "common root"
      ],
      "devDependencies": {
        "ava": "^2.3.0",
        "nyc": "^14.1.1",
        "standard": "^14.0.2"
      },
      "gitHead": "ff573979a038f0946ce27498fd1e570489b8f27d",
      "_id": "common-path-prefix@3.0.0",
      "_nodeVersion": "12.13.0",
      "_npmVersion": "6.12.1",
      "dist": {
        "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
        "shasum": "7d007a7e07c58c4b4d5f433131a19141b29f11e0",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
        "fileCount": 5,
        "unpackedSize": 4007,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvwiCCRA9TVsSAnZWagAAvbsQAJXjzT3boC/8/6udANQA\noiRIFp84lA1K1eOmBlG2Vy0FsaXIZLx4FfAbNKWP/5/DNbpnydl3i20EbXci\nHzBzpOSFFHy3Bl7eqxW1+BRMW3JRUDy8+K8lquT7xQUxYnIvVWwkzkepX09x\nUBNsz1A9psaH00RENL9YhEJFVGZCG1u17MLGjg6bbSwUrfUqEFCAAsHfks6U\n5U+mxWU3jfSoaCoNDsueA8lAZMpr1D+YPLd1T0zVTbhcCgYSWzh4GvT4NJH+\nMru7r4sWzeqs6KAkHKMaLDdtf4/WemDrWu3Q7gtTWH7CgkEY8OkTw6NtkmN+\ng0iSCE9z7qiTl6ZnfliCEFvnRBwZe3L4NRCW0x5vpFNycUzDFFKe45lBRGf3\nhkjQ6zMzjJqZ5MBfgE0sY+3f7b44K7G9SVjzDaajUomAmq0hqyJZRd8ROTIk\nzmcoc2Wxe4utqLmC1vk9I9dCl1PObzpegaKJrR149oTeygl3dgM2OS5aJVUJ\njH++KFjcWQmwotcpq68vYvmu/2Vs3HepVYY/NZH1QfvNFtQmA9MqcukDjnaQ\nZ5k4VdQ2jdXTgWG5ASWOfQ3tHWF3TIIY3IpcQGBUv6whnf0bocZIQuY4kOFd\nqH3HTT5F4ZaC1of4+luiY+zIJ8jO7Jnz5hYOBC+fY4Vwh9jqaHAdBIoq3HrD\nJdgZ\r\n=3eLt\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIF/ImXDhOuPTQXjzEVhluLk/T51W/+P4fTZ34b+S2+/JAiAyVr/q5hOP+lT7sb+n5bWB768b9gd8l+jLlctUhw4+uA=="
          }
        ]
      },
      "maintainers": [
        {
          "name": "novemberborn",
          "email": "mark@novemberborn.net"
        }
      ],
      "_npmUser": {
        "name": "novemberborn",
        "email": "mark@novemberborn.net"
      },
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/common-path-prefix_3.0.0_1572800642368_0.8156717019850825"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "common-path-prefix",
  "time": {
    "modified": "2026-05-13T13:50:41.194Z",
    "created": "2016-01-11T16:43:02.585Z",
    "1.0.0": "2016-01-11T16:43:02.585Z",
    "2.0.0": "2019-08-28T08:17:27.273Z",
    "3.0.0": "2019-11-03T17:04:02.458Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/novemberborn/common-path-prefix#readme"
}