mime-db
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Mime-db is an extensive database of MIME (Multipurpose Internet Mail Extensions) types along with valuable metadata about them. This JavaScript package does not entail any underlying logic, thereby making it as unbiased as possible with an API. It assembles data from prominent resources such as IANA, Apache, and Nginx, thereby making it a comprehensive source for MIME types information.
To use mime-db, you must first install the package via npm by using the npm install mime-db command in your terminal. Once installed, you can require the 'mime-db' module in your JavaScript file and access data related to specific MIME types. For example, to grab data on .js files, use the following JavaScript snippet:
var db = require('mime-db')
//grab data on .js files
var data = db['application/javascript']
This would extract data associated with the MIME type 'application/javascript' and store it in the variable 'data'.
The documentation for mime-db is located in the README file in the repository on GitHub. It details the usage, installation, data structure, and contribution guidelines. Since the JSON file provided by mime-db is a map lookup for lowercased mime types, you can get the payloads of specific MIME types including their source, known extensions, gzip compatibility, and any associated default charset. Additional information is also provided on how to contribute to this open-source project by adding custom media types.