# parse-mime

> A centralized parsing module that can be extended to handle any mime type

Latest version **0.1.0** (published 2014-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-mime
pnpm add parse-mime
yarn add parse-mime
bun add parse-mime
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-11-28 |
| First published | 2014-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Rosoman |
| Maintainers | jkroso |
| Keywords | parse, mime |

## Links

- npm: https://www.npmjs.com/package/parse-mime
- Repository: https://github.com/jkroso/parse-mime
- Issues: https://github.com/jkroso/parse-mime/issues
- npm.io page: https://npm.io/package/parse-mime

## Dependencies (1)

- [qs](https://npm.io/package/qs.md) *

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-11-28

## README

# parse-mime

A centralized parsing module that can be extended to handle any mime type

## Installation

With [packin](//github.com/jkroso/packin): `packin add jkroso/parse-mime`

then in your app:

```js
var parse = require('parse-mime')
```

## API

### `parse(mime, data)`

Takes a mimetype string and some data and returns the parsed value. If it doesn't know how to parse the given mimetype it will just return the data unchanged

```js
parse('application/json', '[1,2,3]') // => [1,2,3]
```

### `parse.define(mime, fn)`

Define a parser for a new mimetype

```js
parse.define('application/edn', JSON.parse)
parse('application/edn', '[1,2,3]') // => [1,2,3]
```

If the mimetype has already been defined then it will throw an error

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