https://github.com/bcherny/content-type-to-ext
Map content-type to file extension (and vice-versa)
https://github.com/bcherny/content-type-to-ext
content-type extension file mime-type
Last synced: 8 months ago
JSON representation
Map content-type to file extension (and vice-versa)
- Host: GitHub
- URL: https://github.com/bcherny/content-type-to-ext
- Owner: bcherny
- Created: 2017-09-08T05:14:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-08T05:17:53.000Z (about 8 years ago)
- Last Synced: 2024-12-17T03:03:19.889Z (10 months ago)
- Topics: content-type, extension, file, mime-type
- Language: TypeScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# content-type-to-ext [![Build Status][build]](https://circleci.com/gh/bcherny/content-type-to-ext) [![npm]](https://www.npmjs.com/package/content-type-to-ext) [![mit]](https://opensource.org/licenses/MIT)
[build]: https://img.shields.io/circleci/project/bcherny/content-type-to-ext.svg?branch=master&style=flat-square
[npm]: https://img.shields.io/npm/v/content-type-to-ext.svg?style=flat-square
[mit]: https://img.shields.io/npm/l/content-type-to-ext.svg?style=flat-square> Map Content-Type to file extension (and vice-versa)
## Installation
```sh
# Using Yarn:
yarn add content-type-to-ext# Or, using NPM:
npm install content-type-to-ext --save
```## Usage
```js
import { getContentType, getExtension } from 'content-type-to-ext'getContentType('jpg') // image/jpeg
getExtension('image/jpeg') // jpg
```## Tests
```sh
npm test
```## License
MIT