Skip to content

bukinoshita/is-extname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-extname Build Status

Check file extension name

Install

$ yarn add is-extname

Usage

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