Skip to content

ExternKit/extern-js-mime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extern-js-mime

  • Target : Javascript (NodeJS)
  • Library : mime
  • Last tested version : 1.3.4
  • Available on : Github - NPM

Usage

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');
  }
}

About

NodeJS mime library extern

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages