https://github.com/expressjs/mime-extended
DEPRECATED - Please use mime-types instead.
https://github.com/expressjs/mime-extended
Last synced: 3 months ago
JSON representation
DEPRECATED - Please use mime-types instead.
- Host: GitHub
- URL: https://github.com/expressjs/mime-extended
- Owner: expressjs
- License: mit
- Created: 2014-04-19T14:42:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-13T17:48:30.000Z (over 11 years ago)
- Last Synced: 2024-10-29T14:24:19.572Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/expressjs/mime-types
- Size: 133 KB
- Stars: 8
- Watchers: 13
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!CAUTION]
> **This repository is archived and no longer actively maintained.**
>
> We are no longer accepting issues, feature requests, or pull requests.
> For additional support or questions, please visit the [Express.js Discussions page](https://github.com/expressjs/express/discussions).
---
**Please use [mime-types](https://github.com/expressjs/mime-types) instead**
---
# MIME EXTENDED
Extends the [mime](https://github.com/broofa/node-mime) module with two main features:
- Adds some content types for preprocessor/transpiler languages
- Adds `mime.contentType()`
## Additional types
Checkout [lib/types.json](lib/types.json) for additional content types.
Feel free to make PRs to add your own!
## `mime.contentType(type)`
An easy way to create a `content-type` header just by setting an extension or mime type,
just like how Express and Koa works!
```js
mime.contentType('html') // => text/html; charset=utf-8
mime.contentType('json') // => application/json
```
## Notes
This augments the `mime` module globally.
It also loosely depends on `mime`,
so you might want to pin `mime` in your app.