contentful-mimetype []
Mimetype handling and identification
This is mostly used by the UI to figure out which icons to show for different filetypes.
It does a best effort guess to figure out which icon to show, which might not always come out very accurate.
It should be updated over time with relevant file types and mime types and it is by no means a definitive representation of all available file types.
Glossary
- type - A media/MIME type http://en.wikipedia.org/wiki/Internet_media_type
- group - A group of types that corresponds to a more global type of
media (ex: plaintext, image, video, audio, etc)
- group name - the display name for a given group
- group label - the label used to identify a group in
fileGroups.json
and groupNames.json
API
Options object used by various methods
The methods that take this object as a parameter will always try to use
the type if available. If the type is not available or is undefined, it
will use the file extension as a fallback. You can also provide a
fallback file name from which the extension will be extracted if not
provided.
getGroupNames
getGroupName
getGroupLabels
getGroupLabel
getExtension
getTypesForGroup
hasPreview
typeExists
getValidTypes
License
This repository is published under the MIT license.