[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] mimetypes 1.0.0
- From: Tang Daogang <daogangtang@...>
- Date: Fri, 21 Jan 2011 10:20:00 +0800
On Fri, Jan 21, 2011 at 10:14 AM, Matthew Frazier <firstname.lastname@example.org>
I have just finished the first version of `mimetypes`, a Lua library that guesses MIME types for filenames. For example:
> mimetypes = require 'mimetypes'
> = mimetypes.guess "index.html"
> = mimetypes.guess "mimetypes.lua"
> = mimetypes.guess "report.docx"
> = mimetypes.guess "README"
> = mimetypes.guess "notreal.extension"
You can also have it guess from your own database of MIME types. The built-in database was mostly obtained from Python 2.7.1's `mimetypes.py` module, as well as Xavante's MIME types file and Rack::Mime from Rack.
Its home page is at <https://bitbucket.org/leafstorm/lua-mimetypes/>, and you can download it from the "Downloads" tab there. (If I got a MIME type wrong, file an issue on the site so as not to flood the list.) All the documentation is in the README file, and there is also a small test file you can run.
The rockspec hasn't been published yet, but it should be soon, and once it is you will be able to run `luarocks install mimetypes` to install it.
Thanks, Matthew Frazier