Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extention and ES6 support #315

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unreleased
==========
1.52.1 / 2024-02-21
===================

* Add extension `.sql` to `application/sql`
* Add extensions `.aac` and `.adts` to `audio/aac`
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json
var db = require('mime-db')

// grab data on .js files
var data = db['application/javascript']
var data = db['application/javascript'];

// grab mime types for extension
var type = db.extension['js'];
```

## Data Structure

The JSON file is a map lookup for lowercased mime types.
Each mime type has the following properties:
### db.json

The JSON file is a map lookup for lower-cased mime types. Each mime type has
the following properties:

- `.source` - where the mime type is defined.
If not set, it's probably a custom media type.
Expand All @@ -57,6 +62,12 @@ Each mime type has the following properties:

If unknown, every property could be `undefined`.

### db-ext.json

The JSON file is a map lookup for lower-cased file extensions. Each file
extension is an array with the list of lower-cased mime types in order of
preference.

## Contributing

The primary way to contribute to this database is by updating the data in
Expand Down
Loading
Loading