valid-mimetype

Validate mimetype strings

Usage no npm install needed!

<script type="module">
  import validMimetype from 'https://cdn.skypack.dev/valid-mimetype';
</script>

README

valid-mimetype

npm GitHub repository license

Validate mimetype strings. This module is for determining whether a string follows the mimetype string format found in IETF RFC 6838.

import * as vmt from "validate-mimetype";
vmt.isValidMimeType("application/html+xml");        // ⇒ true
vmt.isValidMimeType("application/x-7z-compressed"); // ⇒ true
vmt.isValidMimeType("audio/3gpp2");                 // ⇒ true

Build & Test

npm run build
npm test

License

See the LICENSE file for license information.