https://github.com/bukinoshita/is-extname
Check file extension name
https://github.com/bukinoshita/is-extname
extension extname file filetype type
Last synced: 7 months ago
JSON representation
Check file extension name
- Host: GitHub
- URL: https://github.com/bukinoshita/is-extname
- Owner: bukinoshita
- License: mit
- Created: 2017-10-17T19:18:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:50:19.000Z (almost 3 years ago)
- Last Synced: 2025-02-13T18:53:18.909Z (9 months ago)
- Topics: extension, extname, file, filetype, type
- Language: JavaScript
- Homepage:
- Size: 142 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-extname [](https://travis-ci.org/bukinoshita/is-extname)
> Check file extension name
## Install
```bash
$ yarn add is-extname
```
## Usage
```js
const isExtname = require('is-extname')
const create = async file => {
const extname = isExtname(file, 'json')
if (extname) {
return await create()
}
return new TypeError(`We don't support this type of file.`)
}
```
## License
MIT © [Bu Kinoshita](https://bukinoshita.io)