Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update readme

  • Loading branch information...
commit 5712bec43163bccaed2bcc26cfd62a31c7d15f8e 1 parent ad82eba
@broofa authored
Showing with 10 additions and 11 deletions.
  1. +10 −11 README.md
View
21 README.md
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.