Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yihui/mime
Map filenames to MIME types
https://github.com/yihui/mime
mime-types r
Last synced: 9 days ago
JSON representation
Map filenames to MIME types
- Host: GitHub
- URL: https://github.com/yihui/mime
- Owner: yihui
- Created: 2014-04-15T22:42:30.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2022-08-22T17:16:47.000Z (about 2 years ago)
- Last Synced: 2024-05-08T16:02:59.282Z (6 months ago)
- Topics: mime-types, r
- Language: R
- Homepage: https://cran.rstudio.com/package=mime
- Size: 63.5 KB
- Stars: 30
- Watchers: 6
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - yihui/mime - Map filenames to MIME types (R)
README
# mime
[![R-CMD-check](https://github.com/yihui/mime/workflows/R-CMD-check/badge.svg)](https://github.com/yihui/mime/actions)
[![CRAN release](https://www.r-pkg.org/badges/version/mime)](https://cran.r-project.org/package=mime)This is an R package for mapping filename extensions to [MIME
types](https://en.wikipedia.org/wiki/Internet_media_type), based on the data
[derived](R/mime.R) from `/etc/mime.types`.```r
# installation
install.packages('mime')library(mime)
guess_type(c('a/b/c.html', 'd.pdf', 'e.odt', 'foo.docx', 'tex'))
# [1] "text/html"
# [2] "application/pdf"
# [3] "application/vnd.oasis.opendocument.text"
# [4] "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
# [5] "text/x-tex"
```