Permalink
Browse files

update readme

  • Loading branch information...
1 parent ad82eba commit 5712bec43163bccaed2bcc26cfd62a31c7d15f8e @broofa committed Sep 16, 2010
Showing with 10 additions and 11 deletions.
  1. +10 −11 README.md
View
@@ -2,18 +2,17 @@ A library for doing simple mime-type lookups.
var mime = require('mime');
- // all these return 'text/plain'
- mime.lookup('/path/to/file.txt');
- mime.lookup('file.txt');
- mime.lookup('.txt');
+ mime.lookup('/path/to/file.txt'); // => 'text/plain'
+ mime.lookup('file.txt'); // => 'text/plain'
+ mime.lookup('.txt'); // => 'text/plain'
+ mime.lookup('htm'); // => 'text/html'
-It can also look up common charsets for specific mime-types. (Useful in a web
-framework):
+... and extension lookups by mime-type
- var mime = require('mime');
+ mime.lookup('text/html'); // => 'htm'
+ mime.lookup('application/octet-stream'); // => 'bin'
- // returns 'UTF-8'
- mime.charset.lookup('text/plain');
+It also includes rudimentary logic for determining charsets. (Useful in a web
+framework):
-Please help me make sure my lookup tables are complete! Any additions will be
-appreciatively merged!
+ mime.charset.lookup('text/plain'); // => 'UTF-8'

0 comments on commit 5712bec

Please sign in to comment.