Permalink
Browse files

Added comments to node.types providing rational (or lack thereof) for…

… the types we've got there.

- removed octet-stream and appcache types from node.types now that they're in mime.types
  • Loading branch information...
1 parent 8f2c606 commit 7a7fa3be291dad9825bffd583348eadaf9c43177 @broofa committed Sep 5, 2011
Showing with 35 additions and 4 deletions.
  1. +2 −1 README.md
  2. +32 −2 node.types
  3. +1 −1 test.js
View
@@ -10,7 +10,8 @@ Install with [npm](http://github.com/isaacs/npm):
## API
-### mime.lookup(path) - lookup the type for a file or extension
+### mime.lookup(path)
+Get the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so:
var mime = require('mime');
View
@@ -1,7 +1,37 @@
+###
+# EDITORS: When proposing new types be added here, please short "What"/"Why"
+# info explaining why the enhancements should be made (as opposed to, say,
+# simply using mime.load() to customize node-mime in your local project).
+# Thanks!
+###
+
+# What: HTML5 application cache manifest
+# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
+# per https://developer.mozilla.org/en/offline_resources_in_firefox
+text/cache-manifest appcache manifest
+
+# What: Music formats used by iTunes.
+# Why: #1 music service, millions of these files around
application/mp4 m4p
-application/octet-stream bin buffer
audio/mp4 m4a
-text/cache-manifest appcache manifest
+
+# REMOVE? Looks like this was an aborted proposal from mozilla for their webapp
+# support. Can't find much info about it.
application/x-web-app-manifest+json webapp
+
+# What: A music playlist format
+# Why: A de-facto standard, supported by a variety of music players.
+# See http://en.wikipedia.org/wiki/M3U
application/x-mpegURL m3u8
+
+# What: Video format
+# Why: Part of RFC1890
video/MP2T ts
+
+# PROMOTED - This is now an Apache supported type (i.e. it's in
+# mime.types). Possible compatibility issue for anyone relying on ".buffer"
+# extension that we'd defined here previously - If this is an issue for you,
+# 'suggest you use mime.load() to load a local types file with an definition
+# appropriate for your project.
+#
+# application/octet-stream bin buffer
View
@@ -50,7 +50,7 @@ exports["test mime lookup uppercase"] = function(test) {
};
exports["test custom types"] = function(test) {
- test.equal('application/octet-stream', mime.lookup('file.buffer'));
+ test.equal('application/octet-stream', mime.lookup('file.bin'));
test.equal('audio/mp4', mime.lookup('file.m4a'));
test.finish();

0 comments on commit 7a7fa3b

Please sign in to comment.