@anio-js-foundation/get-mime-type

1.0.0 • Public • Published

@anio-js-foundation/get-mime-type

Determine mime type by file name.

import getMimeType from "@anio-js-foundation/get-mime-type"

// application/zip
console.log(getMimeType("test.zip"))
// application/octet-stream
console.log(getMimeType("test.tar.gz"))
// audio/mpeg
console.log(getMimeType("test.mp3"))
// application/javascript
console.log(getMimeType("test.js"))
// application/javascript
console.log(getMimeType("test.mjs"))

// .bin
console.log(getMimeType.reverse("application/octet-stream"))
// .mp3
console.log(getMimeType.reverse("audio/mpeg"))

Readme

Keywords

none

Package Sidebar

Install

npm i @anio-js-foundation/get-mime-type

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.8 kB

Total Files

3

Last publish

Collaborators

  • exory2024
  • dasdeo