https://github.com/frenchbread/filename-ends-with
Check if filename ends with specific string.
https://github.com/frenchbread/filename-ends-with
Last synced: 10 months ago
JSON representation
Check if filename ends with specific string.
- Host: GitHub
- URL: https://github.com/frenchbread/filename-ends-with
- Owner: frenchbread
- License: mit
- Created: 2016-08-01T10:18:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-02T10:29:10.000Z (almost 10 years ago)
- Last Synced: 2025-07-06T02:11:22.222Z (11 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# filename-ends-with
> Check if filename ends with specific string.
[](https://nodei.co/npm/filename-ends-with/)
### Installation
```
$ npm install filename-ends-with --save
```
### Usage
```js
import fEndsWith from 'filename-ends-with';
fEndsWith('somefilename.jpg', '.jpg');
// => true
fEndsWith('somefilename.jpeg', '.jpg');
// => false
fEndsWith('somefilename.txt', ['.md', '.json', '.txt']);
// => true
```
### Tests
```
$ npm test
```
### License
[MIT](https://github.com/frenchbread/filename-ends-with/blob/master/LICENSE)