filename-ends-with
Version:
Check if filename ends with a specific string.
36 lines (22 loc) • 498 B
Markdown
> Check if filename ends with specific string.
```
$ npm install filename-ends-with --save
```
```js
import fEndsWith from 'filename-ends-with';
fEndsWith('somefilename.jpg', '.jpg');
// => true
fEndsWith('somefilename.jpeg', '.jpg');
// => false
fEndsWith('somefilename.txt', ['.md', '.json', '.txt']);
// => true
```
```
$ npm test
```
[](https://github.com/frenchbread/filename-ends-with/blob/master/LICENSE)