# path-ends-with

> Return `true` if a file path ends with the given string/suffix.

Latest version **2.0.0** (published 2018-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-ends-with
pnpm add path-ends-with
yarn add path-ends-with
bun add path-ends-with
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-03-18 |
| First published | 2014-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | path, ends-with, matches, match |

## Links

- npm: https://www.npmjs.com/package/path-ends-with
- Repository: https://github.com/jonschlinkert/path-ends-with
- Issues: https://github.com/jonschlinkert/path-ends-with/issues
- npm.io page: https://npm.io/package/path-ends-with

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-03-18
- 1.1.0 — 2017-04-17
- 1.0.1 — 2017-04-15
- 1.0.0 — 2017-04-15
- 0.2.3 — 2015-10-10
- 0.2.2 — 2015-10-04
- 0.2.1 — 2014-10-19
- 0.2.0 — 2014-10-16
- 0.1.1 — 2014-06-26
- 0.1.0 — 2014-06-26

## README

# path-ends-with [![NPM version](https://img.shields.io/npm/v/path-ends-with.svg?style=flat)](https://www.npmjs.com/package/path-ends-with) [![NPM monthly downloads](https://img.shields.io/npm/dm/path-ends-with.svg?style=flat)](https://npmjs.org/package/path-ends-with) [![NPM total downloads](https://img.shields.io/npm/dt/path-ends-with.svg?style=flat)](https://npmjs.org/package/path-ends-with) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/path-ends-with.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/path-ends-with) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/path-ends-with.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/path-ends-with)

> Return `true` if a file path ends with the given string/suffix.

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save path-ends-with
```

## Usage

```js
const endsWith = require('path-ends-with');

console.log(endsWith('foobar', 'bar'));  //=> false 
console.log(endsWith('foo/bar', 'bar')); //=> true
```

## Options

### options.nocase

**Type**: `boolean`

**Default**: `undefined`

Enable case sensitivity.

```js
endsWith('foo/bar', 'BAR');
//=> false
endsWith('foo/bar', 'BAR', { nocase: true }); 
//=> true
```

### options.partialMatch

**Type**: `boolean`

**Default**: `false`

Allow matching against part of a path segment.

```js
endsWith('foobar', 'bar');                          
//=> false                 
endsWith('foobar', 'bar', { partialMatch: true });  
//=> true 
```

## Release history

### v2.0

**Breaking changes**

* No longer supports leading `!` as a negation character.

## About

<details>
<summary><strong>Contributing</strong></summary>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

</details>

<details>
<summary><strong>Running Tests</strong></summary>

Running 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:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(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.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

</details>

### Related projects

You might also be interested in these projects:

* [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.")
* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.")
* [normalize-path](https://www.npmjs.com/package/normalize-path): Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a… [more](https://github.com/jonschlinkert/normalize-path) | [homepage](https://github.com/jonschlinkert/normalize-path "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.")
* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.")

### Author

**Jon Schlinkert**

* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)

### License

Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 17, 2018._

---
_Source: https://npm.io/package/path-ends-with · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
