import js.mime.*;
class Main
{
static function main()
{
Mime.lookup('/path/to/file.txt'); // => 'text/plain'
Mime.lookup('file.txt'); // => 'text/plain'
Mime.lookup('.TXT'); // => 'text/plain'
Mime.lookup('htm'); // => 'text/html'
Mime.extension('text/html'); // => 'html'
Mime.extension('application/octet-stream'); // => 'bin'
Mime.charsets.lookup('text/plain'); // => 'UTF-8'
Mime.define({
'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],
'application/x-my-type': ['x-mt', 'x-mtt'],
// etc ...
});
Mime.lookup('x-sft'); // => 'text/x-some-format'
Mime.extension('text/x-some-format'); // => 'x-sf'
Mime.load('./my_project.types');
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
NodeJS mime library extern
License
ExternKit/extern-js-mime
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
NodeJS mime library extern
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published