# mimer

> A simple Mime type getter

Latest version **2.0.2** (published 2021-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install mimer
pnpm add mimer
yarn add mimer
bun add mimer
```

Provides the command `mimer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-08-22 |
| First published | 2013-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 12 |
| Dependencies | 0 |
| Unpacked size | 43.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Helder Santana |
| Maintainers | ruyadorno, helder, caiogondim |
| Keywords | mime, mimetype, file, extension, extensions |

## Links

- npm: https://www.npmjs.com/package/mimer
- Repository: https://github.com/heldr/mimer
- Homepage: https://github.com/heldr/mimer#readme
- Issues: https://github.com/heldr/mimer/issues
- npm.io page: https://npm.io/package/mimer

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2021-08-22
- 2.0.1 — 2021-08-22
- 2.0.0 — 2021-08-22
- 1.1.1 — 2021-08-10
- 1.1.0 — 2020-05-03
- 1.0.0 — 2019-04-17
- 0.3.2 — 2018-02-10
- 0.3.1 — 2018-02-10
- 0.3.0 — 2018-02-10
- 0.2.3 — 2017-12-11
- 0.2.2 — 2017-12-11
- 0.2.1 — 2014-03-26
- 0.2.0 — 2014-03-26
- 0.1.1 — 2014-01-25
- 0.1.0 — 2013-04-26

## README

# Mimer [![Build Status](https://github.com/data-uri/mimer/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/data-uri/mimer/actions/workflows/main.yml?query=branch%3Amain) [![install size](https://packagephobia.com/badge?p=mimer)](https://packagephobia.com/result?p=mimer)

A file extension to [MIME](http://en.wikipedia.org/wiki/MIME) type module. Uses [mime-db](https://npm.im/mime-db) data but with zero dependencies.

## Getting started
`npm install mimer` or `npx mimer <file>`.

### Module
```js
const mimer = require('mimer');

mimer('.pdf'); // -> "application/pdf"
mimer('pdf'); // -> "application/pdf"
mimer('../readme.pdf'); // -> "application/pdf"
mimer('pedefe'); // -> "application/octet-stream"
```

#### Extension Map
```js
const mimer = require('mimer');
const mimerMap = require('mimer/map');

mimerMap.get('pdf'); // -> "application/pdf"
mimerMap.set('graphql', 'application/graphql');
mimer('content.graphql'); // -> "application/graphql"
```

#### Safe mode
In case you want to avoid changes on original Map for safety.
```js
const mimer = require('mimer/safe');
const mimerMap = require('mimer/map');

mimerMap.set('graphql', 'application/graphql');
mimer('content.graphql'); // -> "application/octet-stream"
```

## CLI

```sh
npm install -g mimer
mimer readme.pdf
```
or just

```sh
npx mimer readme.pdf
```

## Contribute

Just create a new Github Codespace or:

```sh
$ git clone https://github.com/data-uri/mimer.git
$ cd mimer
$ npm i
$ npm test
```

## [Changelog](https://github.com/data-uri/mimer/releases).

## License

MIT License
(c) [Helder Santana](http://heldr.com)

---
_Source: https://npm.io/package/mimer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
