Skip to content
Browse files

added note about default mime type

It threw me for a loop when .ini returned application/octet-stream 
and I couldn't find it in the lists.
  • Loading branch information...
1 parent 2e46729 commit 1107bca8b358cd190ccbe1cea88239f58e1ba32b @matthewkastor matthewkastor committed Mar 18, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 README.md
View
5 README.md
@@ -11,7 +11,7 @@ Install with [npm](http://github.com/isaacs/npm):
## API - Queries
### mime.lookup(path)
-Get the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.
+Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.
var mime = require('mime');
@@ -20,6 +20,9 @@ Get the mime type associated with a file. Performs a case-insensitive lookup usi
mime.lookup('.TXT'); // => 'text/plain'
mime.lookup('htm'); // => 'text/html'
+### mime.default_type
+Sets the default mime type returned when `mime.lookup` fails to find the extension searched for.
+
### mime.extension(type)
Get the default extension for `type`

0 comments on commit 1107bca

Please sign in to comment.
Something went wrong with that request. Please try again.