{"_id":"path-starts-with","_rev":"6-976b0bb61608e6926de43dff991a90ae","name":"path-starts-with","description":"Returns true if a filepath starts with the given string. Works with windows and posix/unix paths.","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"path-starts-with","description":"Returns true if a filepath starts with the given string. Works with windows and posix/unix paths.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/path-starts-with","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/path-starts-with.git"},"bugs":{"url":"https://github.com/jonschlinkert/path-starts-with/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"dependencies":{"normalize-path":"^2.1.1"},"devDependencies":{"gulp-format-md":"^0.1.12","mocha":"^3.2.0"},"keywords":["generategenerator","path","starts","with"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["path-ends-with","contains-path","normalize-path"]},"lint":{"reflinks":true}},"gitHead":"8f3d31a61a10b1733b3f7225ec33551a347ca68d","_id":"path-starts-with@1.0.0","_shasum":"b28243015e8b138de572682ac52da42e646ad84e","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"b28243015e8b138de572682ac52da42e646ad84e","tarball":"https://registry.npmjs.org/path-starts-with/-/path-starts-with-1.0.0.tgz","integrity":"sha512-CQVfSVN+llYh2D0HWG0jUGJ1ua9VbQyANgIo7cBis37FcpKiN13qh7UxttQqXtgcMZgzjpk/9RktoN6up/XLBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIh9z7A8t3uhxzwwryF218FmNLd7IRIhU4aytBzr9ijwIhAI9/j3Rzw6DkVzKudtifcNJRaEcAeAs1KPvOcsmN94h2"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/path-starts-with-1.0.0.tgz_1492411318160_0.7261213778983802"},"directories":{}},"2.0.0":{"name":"path-starts-with","description":"Returns true if a filepath starts with the given string. Works with windows and posix/unix paths.","version":"2.0.0","homepage":"https://github.com/jonschlinkert/path-starts-with","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/path-starts-with.git"},"bugs":{"url":"https://github.com/jonschlinkert/path-starts-with/issues"},"license":"MIT","main":"index.js","engines":{"node":">=8"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^2.0.0","mocha":"^6.1.4"},"keywords":["directory","file path","file","filepath","folder","fs","inside","path","posix","relative","slash","slashes","starts","startsWith","util","utility","utils","windows"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["path-ends-with","contains-path","normalize-path"]},"lint":{"reflinks":true}},"gitHead":"a964356d374df4e27ee820299b0698c2a36284fe","_id":"path-starts-with@2.0.0","_nodeVersion":"12.0.0","_npmVersion":"6.9.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-3UHTHbJz5+NLkPafFR+2ycJOjoc4WV2e9qCZCnm71zHiWaFrm1XniLVTkZXvaRgxr1xFh9JsTdicpH2yM03nLA==","shasum":"ffd6d51926cd497022b44d392196033d5451892f","tarball":"https://registry.npmjs.org/path-starts-with/-/path-starts-with-2.0.0.tgz","fileCount":4,"unpackedSize":10028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxrjHCRA9TVsSAnZWagAAmfcP/1VKC2IPVKSMdPEXIzlV\nUztF29Aoi2D3gpuICXZ4EPT5OLZzpGVuRK9YFv3hW7lYxCxI39gyD+qFA8Hk\nWk+IatfFhtfc4gSu8RoXnoiIa6sIuyD0k1ANECeuurQh+DJ4NEDjbIpi7XD4\nvO3cCG0JUTw4+qCtoy9uRoLu0XtMCYqRktsMDC7km/dRoibAYnesSOuGRlQR\nb0oIWr5eEjLCfLPcWpyqF12F0GA1QQFpJYfbs81WeXjaxulkGH7w/29vtr4Y\nxWr4x1ZFOojsiiYhxLfsidYP3dtWvJE8XEkGFijjlb0L95Kq+/lfzJcwRkxE\nQttStzoAFlGAECHxwgKVm3Yr68S1fXR0kUtwj3mWfViMeTcBEd54jt2uwApf\nh/Mha1a228Fcj+A4c6eDp4Me9ZuHdA24TrXockuXrU5YZkc6INda+GRElosi\nY3YHMhf8rqAAHiGOvqTHIOQ5Mi2EAOrc6ii75tEKWoq9j7GtwvZ5WoWdDe3n\norTHbbuuSAUoPZ8t20k/zEu531eY4dHk8uqqbEH/omHW3E7xrNgaorlVMfUt\nI8jEUEjJjNejemqwGRxfqF9Z06rCcHR2/ulqS/ewAXqSSzrlQOeZxXUizkB7\nhE4YC5lcFQfXSIMzcnFQmr5PmDgj8ZlcmY6nYjWkvJtlC6UtpiVf+vxyyuR3\nvGYB\r\n=UaNi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyFtH9Oz386R/t1tcOmSh2xiDS0nIowJb2D7/JawSkKAIgcZoAyi/HCkSuuhcPUjINt4Kh2KwBcKwgGpuN7uDZ8b4="}]},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/path-starts-with_2.0.0_1556527303107_0.3569409173525979"},"_hasShrinkwrap":false},"2.0.1":{"name":"path-starts-with","description":"Returns true if a filepath starts with the given string. Works with windows and posix/unix paths.","version":"2.0.1","homepage":"https://github.com/jonschlinkert/path-starts-with","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/path-starts-with.git"},"bugs":{"url":"https://github.com/jonschlinkert/path-starts-with/issues"},"license":"MIT","main":"index.js","engines":{"node":">=8"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^2.0.0","mocha":"^6.1.4"},"keywords":["directory","file path","file","filepath","folder","fs","inside","path","posix","relative","slash","slashes","starts","startsWith","util","utility","utils","windows"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["path-ends-with","contains-path","normalize-path"]},"lint":{"reflinks":true}},"gitHead":"d0eb3c7ec096acf2d0e15cfda838e1e5b2506734","_id":"path-starts-with@2.0.1","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-wZ3AeiRBRlNwkdUxvBANh0+esnt38DLffHDujZyRHkqkaKHTglnY2EP5UX3b8rdeiSutgO4y9NEJwXezNP5vHg==","shasum":"cd8b6213c141a9f2dd86c748310acdfa6493abb1","tarball":"https://registry.npmjs.org/path-starts-with/-/path-starts-with-2.0.1.tgz","fileCount":4,"unpackedSize":9725,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFN4oJZOw4S6inDkyUTx+Rj8JJC0PTXsnN2nj//Ul69dAiAZtjx1a3i89jOkyjC+V4R9zAYSk2j3bhU/z1J//wwK1Q=="}]},"_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"directories":{},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/path-starts-with_2.0.1_1690673158612_0.1568156133074956"},"_hasShrinkwrap":false}},"readme":"# path-starts-with [![NPM version](https://img.shields.io/npm/v/path-starts-with.svg?style=flat)](https://www.npmjs.com/package/path-starts-with) [![NPM monthly downloads](https://img.shields.io/npm/dm/path-starts-with.svg?style=flat)](https://npmjs.org/package/path-starts-with) [![NPM total downloads](https://img.shields.io/npm/dt/path-starts-with.svg?style=flat)](https://npmjs.org/package/path-starts-with)\n\n> Returns true if a filepath starts with the given string. Works with windows and posix/unix paths.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save path-starts-with\n```\n\n## Usage\n\n```js\nvar startsWith = require('path-starts-with');\n\nconsole.log(startsWith('foo/bar', 'foo')); //=> true\nconsole.log(startsWith('foo/bar', 'bar')); //=> false\n```\n\n## Negation\n\nPrefix the substring with `!` to return true when the path _does not_ start with the substring.\n\n```js\nconsole.log(startsWith('foo/bar', '!foo')); //=> false\nconsole.log(startsWith('foo/bar', '!bar')); //=> true\n```\n\n## options\n\n### options.nocase\n\n**Type**: `boolean`\n\n**Default**: `false`\n\nDisable case sensitivity.\n\n```js\nstartsWith('foo/bar', 'FOO');                 \n//=> false\nstartsWith('foo/bar', 'FOO', {nocase: true}); \n//=> true\n```\n\n### options.partialMatch\n\n**Type**: `boolean`\n\n**Default**: `false`\n\nAllow partial matches:\n\n```js\nstartsWith('foobar', 'foo');  //=> false                 \nstartsWith('foo.bar', 'foo'); //=> false                 \n\nstartsWith('foobar', 'foo', {partialMatch: true});  //=> true \nstartsWith('foo.bar', 'foo', {partialMatch: true}); //=> true \n```\n\n## Comparison behavior\n\n### Windows paths\n\nBackslashes are converted to forward slashes before the comparison is done. Thus, both of the following would be `true`:\n\n```js\nconsole.log(startsWith('foo\\\\bar', 'foo/bar')); //=> true\nconsole.log(startsWith('foo/bar', 'foo\\\\bar')); //=> true\n```\n\n### Leading dot-slash\n\nLeading `./` is stripped from both the filepath and substring. Thus, both of the following would be `true`:\n\n```js\nconsole.log(startsWith('./foo/bar', 'foo')); //=> true\nconsole.log(startsWith('foo/bar', './foo')); //=> true\n```\n\n### Leading slashes\n\nWhen the substring is prefixed with leading slashes, _the number of leading slashes_ must match exactly.\n\n```js\nconsole.log(startsWith('/foo', '/foo'));      //=> true\nconsole.log(startsWith('/foo/bar', '/foo'));  //=> true\n\nconsole.log(startsWith('/foo/bar', '//foo')); //=> false\nconsole.log(startsWith('//foo/bar', '/foo')); //=> false\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path \"Return true if a file path contains the given path.\")\n* [normalize-path](https://www.npmjs.com/package/normalize-path): Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes… [more](https://github.com/jonschlinkert/normalize-path) | [homepage](https://github.com/jonschlinkert/normalize-path \"Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.\")\n* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with \"Return `true` if a file path ends with the given string/suffix.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 29, 2023._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2023-07-29T23:25:58.843Z","created":"2017-04-17T06:42:00.036Z","1.0.0":"2017-04-17T06:42:00.036Z","2.0.0":"2019-04-29T08:41:43.252Z","2.0.1":"2023-07-29T23:25:58.732Z"},"homepage":"https://github.com/jonschlinkert/path-starts-with","keywords":["directory","file path","file","filepath","folder","fs","inside","path","posix","relative","slash","slashes","starts","startsWith","util","utility","utils","windows"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/path-starts-with.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/path-starts-with/issues"},"license":"MIT","readmeFilename":"README.md","users":{"rbecheras":true}}