Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Nov 5, 2024
1 parent 6f85742 commit 01ebfe6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ A small package to transform between file extensions and MIME types, with bonus
```julia
julia> using MIMEs

### For filename extensions:
julia> m = mime_from_extension(".json")
MIME type application/json

julia> extension_from_mime(m)
".json"


### For web servers:
julia> compressible_from_mime(m) # whether content of this MIME can/should be gzipped
true

Expand All @@ -19,6 +22,9 @@ julia> charset_from_mime(m)

julia> contenttype_from_mime(m) # the Content-Type HTTP header
"application/json; charset=utf-8"

julia> mime_from_contenttype("application/json; charset=utf-8")
MIME type application/json
```

# Implementation
Expand Down
2 changes: 1 addition & 1 deletion src/MIMEs.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module MIMEs

export mime_from_extension, mime_from_path, extension_from_mime, charset_from_mime, compressible_from_mime, contenttype_from_mime
export mime_from_extension, mime_from_path, extension_from_mime, charset_from_mime, compressible_from_mime, contenttype_from_mime, mime_from_contenttype

const _mimedb, _ext2mime, _mime2ext = include(joinpath(@__DIR__, "..", "mimedb", "mimedb.jlon"))

Expand Down

0 comments on commit 01ebfe6

Please sign in to comment.