npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nxtedition/mime

v1.1.7

Published

MIME type lookup and extension resolution with built-in support for broadcast and professional media formats missing from the standard `mime` package.

Readme

@nxtedition/mime

MIME type lookup and extension resolution with built-in support for broadcast and professional media formats missing from the standard mime package.

Install

npm install @nxtedition/mime

Usage

Lookup MIME type by filename

import { lookup } from '@nxtedition/mime'

lookup('video.mxf') // 'application/mxf'
lookup('video.mp4') // 'video/mp4'
lookup('video.nut') // 'video/x-nut'
lookup('audio.ac3') // 'audio/ac3'
lookup('subs.stl') // 'application/x-ebu-stl'
lookup('subs.scc') // 'text/x-scc'

// Bare extensions work too (like the standard mime package):
lookup('nut') // 'video/x-nut'
lookup('dnxhd') // 'video/x-dnxhd'

Get extension from MIME type

import { extension } from '@nxtedition/mime'

extension('video/mp4') // 'mp4'
extension('video/x-dnxhd') // 'dnxhd'
extension('audio/ac3') // 'ac3'
extension('application/x-ebu-stl') // 'stl'
extension('video/quicktime') // 'mov'

// MIME types are case-insensitive and parameters are ignored:
extension('Video/X-DnxHD; profile=hd') // 'dnxhd'

Broadcast & media types

Types handled beyond (or instead of) the standard mime package:

| Extension | MIME Type | Format | | ---------------------- | ----------------------------- | ------------------------- | | .nut | video/x-nut | NUT container | | .aaf | application/x-aaf | Avid AAF | | .lxf | application/x-lxf | Leitch LXF | | .dnxhd .dnxhr | video/x-dnxhd | Avid DNxHD/DNxHR | | .dv | video/x-dv | DV video | | .h265 .265 .hevc | video/h265 | Raw HEVC stream | | .264 .avc | video/h264 | Raw AVC stream | | .h266 .266 .vvc | video/h266 | Raw VVC stream | | .av1 | video/av1 | Raw AV1 stream | | .ffv1 | video/ffv1 | FFV1 archival codec | | .vc1 | video/vc1 | VC-1 video | | .prores | video/x-prores | Apple ProRes | | .r3d | video/x-red-r3d | RED REDCODE RAW | | .braw | video/x-blackmagic-braw | Blackmagic RAW | | .ari | image/x-arri-ari | ARRIRAW frame | | .ac3 | audio/ac3 | Dolby Digital | | .eac3 .ec3 | audio/eac3 | Dolby Digital Plus | | .opus | audio/opus | Opus audio | | .flac | audio/flac | FLAC lossless | | .pcm-s16le | audio/x-pcm-s16le | Raw 16-bit PCM | | .pcm-s24le | audio/x-pcm-s24le | Raw 24-bit PCM | | .pcm-s32le | audio/x-pcm-s32le | Raw 32-bit PCM | | .bwf | audio/wav | Broadcast Wave | | .w64 | audio/x-w64 | Sony Wave64 | | .rf64 | audio/x-rf64 | EBU RF64 | | .stl | application/x-ebu-stl | EBU STL subtitles | | .scc | text/x-scc | Scenarist Closed Captions | | .cap | application/x-cap | Softel CAP captions | | .890 | application/x-890 | Cavena 890 subtitles | | .pac | application/x-pac | Screen Electronics PAC | | .ass | text/x-ass | Advanced SubStation Alpha | | .ssa | text/x-ssa | SubStation Alpha | | .dfxp .itt | application/ttml+xml | TTML dialects | | .exr | image/x-exr | OpenEXR | | .cin | image/x-cin | Cineon | | .ism | application/vnd.ms-sstr+xml | Smooth Streaming | | .mp3 | audio/mp3 | MP3 (Chrome workaround) |

Camera RAW stills are also covered: cr2, cr3, nef, nrw, arw, srf, sr2, raf, rw2, orf, pef, ptx, x3f, 3fr, fff, iiq, mrw, mef, dng, raw, rwl, k25, kdc, bay, erf, srw, mos — each mapped to its vendor image/x-* type.

Deliberate differences from mime

Some mappings intentionally shadow standard ones for broadcast use. If you serve 3D models, pcap captures, or proxy autoconfig files, this package is not for you:

  • .stlapplication/x-ebu-stl (not model/stl)
  • .capapplication/x-cap (not application/vnd.tcpdump.pcap)
  • .pacapplication/x-pac (not application/x-ns-proxy-autoconfig)
  • .opusaudio/opus (not audio/ogg)
  • .flacaudio/flac (not audio/x-flac)
  • .exrimage/x-exr (not image/aces)
  • .mp3audio/mp3 (not audio/mpeg, see Chromium #227004)

In the reverse direction, common media extensions are preferred over mime-db's first entries:

  • video/quicktimemov (not qt)
  • audio/mpegmp3 (not mpga)
  • audio/aacaac (not adts)

extension() also accepts common alias spellings that have no forward mapping: video/nut, video/dnxhd, video/dv, video/hevc (→ h265), video/x-m2ts, audio/pcm-s16le/-s24le/-s32le (without the x- prefix), and image/x-dpx.

API

lookup(name: string): string | null

Returns the MIME type for the given filename, path, or bare extension, or null if unknown. Matching is case-insensitive and follows the standard mime package's path semantics: the extension is what follows the last dot of the basename, provided that dot is not the basename's first character (a dotfile with a path, like /path/.nut, is extensionless). A name without such an extension is treated as a bare extension only when it has no path component (nut and .nut both resolve).

Also exported as getType.

extension(mimeType: string): string | null

Returns the file extension for the given MIME type, or null if unknown. Matching is case-insensitive and ignores parameters (e.g. ; charset=...).

Also exported as getExtension.

License

MIT