An open API service indexing awesome lists of open source software.

https://github.com/zeachco/real-mime-type

MIME types (IANA media types) can be wrong when the user changes the file extension, this package reads the first bytes of the file to ensure they fit the expectations and reverts to default browser mime types when unsupported
https://github.com/zeachco/real-mime-type

binary binary-search deno file-upload filereader-api mime mime-types npm-package

Last synced: 27 days ago
JSON representation

MIME types (IANA media types) can be wrong when the user changes the file extension, this package reads the first bytes of the file to ensure they fit the expectations and reverts to default browser mime types when unsupported

Awesome Lists containing this project

README

          

# real-mime-type

MIME types (IANA media types) can be wrong when the user changes the file
extension, this package reads the first bytes of the file to ensure they fit the
expectations and reverts to default browser mime types when unsupported

## targets

This package is built using Deno but targets Deno, NPM and ESM

## Generate lib

```bash
deno task dev` for watch mode
```

or

```bash
deno task build` for ci
```

## Demo

https://stackblitz.com/edit/react-ts-eqqh3x?file=App.tsx,UploadValidator.tsx

## NPM Package

[@zeachco/real-mime-types](https://www.npmjs.com/package/@zeachco/real-mime-types)

Publish is public (`npm publish --access public`)

## Contributions to package it properly are welcome