npm.io
1.1.1 • Published 10 years ago

filename-ends-with

Licence
MIT
Version
1.1.1
Deps
1
Vulns
0
Weekly
0

filename-ends-with

Check if filename ends with specific string.

Installation

$ npm install filename-ends-with --save

Usage


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

Keywords