{"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":"http://registry-npm.ywwl.com/path-starts-with/download/path-starts-with-1.0.0.tgz","integrity":"sha512-CQVfSVN+llYh2D0HWG0jUGJ1ua9VbQyANgIo7cBis37FcpKiN13qh7UxttQqXtgcMZgzjpk/9RktoN6up/XLBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIh9z7A8t3uhxzwwryF218FmNLd7IRIhU4aytBzr9ijwIhAI9/j3Rzw6DkVzKudtifcNJRaEcAeAs1KPvOcsmN94h2"}],"size":3329,"noattachment":false,"key":"/path-starts-with/-/path-starts-with-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/path-starts-with-1.0.0.tgz_1492411318160_0.7261213778983802"},"directories":{},"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._","publish_time":1492411320036,"_cnpm_publish_time":1492411320036,"dist-tags":{"latest":"2.0.1"}}