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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ffras4vnpm/cupiditate-aut-quasi

v1.0.0

Published

<!-- -- This file is auto-generated from src/README_js.md. Changes should be made there. --> # Mime

Downloads

57

Maintainers

lank831011lank831011

Keywords

spinnersinspectrateflagasyncBigInt64ArrayestreeStyleSheetescapeECMAScript 2017optimizerReactiveExtensionseast-asian-widthES7openstraversewalkingfindLastapicreatelengthpromisescensorES6CSSinputObjectinternalprotobuftypesafefunctionpreserve-symlinksschemaenvES2023buffersomereduxECMAScript 7queuegradients cssES8serializetypesformatutilslogmake dirchrometypedarrayseditor__proto__dataviewsuperstructstartertc39Streamsoncecommand-lineMicrosoftjson-schema-validatorequaldatastructureWeakMapwarningapollotranspilerspawnwatchtapsetterinterruptsiterationwritableES3privatemacostextmodulesresolvesortclass-validatorpostcsssanitizerangeerrorslotstatustoobjectObservablesextendqsscheme-validationclientbabel-coreArrayBuffer.prototype.slicefast-copyexerapidfastargscallback0wrapdataView256functionales6es-abstractclassesl10nes7deterministicES2022ReactiveXfiletyped arrayReflect.getPrototypeOfcallbounddependency managerworkerlesscsscss variabletoolsstreamttyStreamrequirepnpm9autoprefixerrm -rfes2016Function.prototype.namespeedjasmineperformantjesthandlersxdg-openECMAScript 2015concatMaptranspile$.extendcodestypeerrorcolumngesturesschemedirectorycjkwalktrimLeftentriesauthenticationurlstyled-componentstrimEndeslint-pluginrecursivegdprgraphqlrgbbatchregularfetchObject.getPrototypeOftacithooksobjectwriteECMAScript 2019parentsstringprettytapedataes2018deepa11yslicesignalsimmerexpressionserializerES2020react-hookscharacterslockfileArray.prototype.filternegativeBigUint64ArrayimportArray.prototype.flatMapquerystringlastnopeexecutablecurlsharedspecESnextclonepackage.jsontoolkitcopybufferspyyamlhastslibcolumnsnodejsdrag.envruntime_.extendUint8ClampedArraymetadatawatcherletwgetjsdiffquerystructuredCloneconfigurabletrimStartpreprocessortypeofargumentsstylesmatchAllfind-upemitunicodevalidationeslintcompareflagsreusenamesnpmES2021cssconnecttestertaskserializationinferenceposejoichildes8file systemkarmahelperscliWeakSetvariablespositivesharedarraybufferdefaultwebsitehttpsTypedArrayratelimitopendiffpruneMapprotoTypeScriptUint16ArraychaisetPrototypeOfECMAScript 3mochaJSON-Schemajsonpathpathpropertygradients css3findLastIndexdefinepicomatchwaitintrinsicES5omitajvsymbolsmiddlewareeventDispatchersearchgetOwnPropertyDescriptorponyfilldescriptionsameValueZerolanguagewidth6to5weakmapfastcopysettingsdropecmascriptrmdirvarwordwrapgetPrototypeOfdotenvObject.entrieserror-handlinghookformloggingES2019debuggerjapaneseio-tspolyfillcircularRFC-6455regular expressionsgetoptflatuser-streamsformsemojitermfindupfastifyES2018babelES2017hashsignalvaluejsonschemaxsselectronfolderdom-testing-libraryrequest

Readme

Mime

NPM downloads Mime CI

An API for MIME type information.

  • All @ffras4vnpm/cupiditate-aut-quasi-db types
  • Compact and dependency-free @ffras4vnpm/cupiditate-aut-quasi's badge
  • Full TS support

[!Note] @ffras4vnpm/cupiditate-aut-quasi@4 is now latest. If you're upgrading from @ffras4vnpm/cupiditate-aut-quasi@3, note the following:

  • @ffras4vnpm/cupiditate-aut-quasi@4 is API-compatible with @ffras4vnpm/cupiditate-aut-quasi@3, with ~~one~~ two exceptions:
    • Direct imports of @ffras4vnpm/cupiditate-aut-quasi properties no longer supported
    • @ffras4vnpm/cupiditate-aut-quasi.define() cannot be called on the default @ffras4vnpm/cupiditate-aut-quasi object
  • ESM module support is required. ESM Module FAQ.
  • Requires an ES2020 or newer runtime
  • Built-in Typescript types (@types/@ffras4vnpm/cupiditate-aut-quasi no longer needed)

Installation

npm install @ffras4vnpm/cupiditate-aut-quasi

Quick Start

For the full version (800+ MIME types, 1,000+ extensions):

import @ffras4vnpm/cupiditate-aut-quasi from '@ffras4vnpm/cupiditate-aut-quasi';

@ffras4vnpm/cupiditate-aut-quasi.getType('txt');                    // ⇨ 'text/plain'
@ffras4vnpm/cupiditate-aut-quasi.getExtension('text/plain');        // ⇨ 'txt'

Lite Version @ffras4vnpm/cupiditate-aut-quasi/lite's badge

@ffras4vnpm/cupiditate-aut-quasi/lite is a drop-in @ffras4vnpm/cupiditate-aut-quasi replacement, stripped of unofficial ("prs.*", "x-*", "vnd.*") types:

import @ffras4vnpm/cupiditate-aut-quasi from '@ffras4vnpm/cupiditate-aut-quasi/lite';

API

@ffras4vnpm/cupiditate-aut-quasi.getType(pathOrExtension)

Get @ffras4vnpm/cupiditate-aut-quasi type for the given file path or extension. E.g.

@ffras4vnpm/cupiditate-aut-quasi.getType('js');             // ⇨ 'application/javascript'
@ffras4vnpm/cupiditate-aut-quasi.getType('json');           // ⇨ 'application/json'

@ffras4vnpm/cupiditate-aut-quasi.getType('txt');            // ⇨ 'text/plain'
@ffras4vnpm/cupiditate-aut-quasi.getType('dir/text.txt');   // ⇨ 'text/plain'
@ffras4vnpm/cupiditate-aut-quasi.getType('dir\\text.txt');  // ⇨ 'text/plain'
@ffras4vnpm/cupiditate-aut-quasi.getType('.text.txt');      // ⇨ 'text/plain'
@ffras4vnpm/cupiditate-aut-quasi.getType('.txt');           // ⇨ 'text/plain'

null is returned in cases where an extension is not detected or recognized

@ffras4vnpm/cupiditate-aut-quasi.getType('foo/txt');        // ⇨ null
@ffras4vnpm/cupiditate-aut-quasi.getType('bogus_type');     // ⇨ null

@ffras4vnpm/cupiditate-aut-quasi.getExtension(type)

Get file extension for the given @ffras4vnpm/cupiditate-aut-quasi type. Charset options (often included in Content-Type headers) are ignored.

@ffras4vnpm/cupiditate-aut-quasi.getExtension('text/plain');               // ⇨ 'txt'
@ffras4vnpm/cupiditate-aut-quasi.getExtension('application/json');         // ⇨ 'json'
@ffras4vnpm/cupiditate-aut-quasi.getExtension('text/html; charset=utf8');  // ⇨ 'html'

@ffras4vnpm/cupiditate-aut-quasi.getAllExtensions(type)

[!Note] New in @ffras4vnpm/cupiditate-aut-quasi@4

Get all file extensions for the given @ffras4vnpm/cupiditate-aut-quasi type.

@ffras4vnpm/cupiditate-aut-quasi.getAllExtensions('image/jpeg'); // ⇨ Set(3) { 'jpeg', 'jpg', 'jpe' }

Custom Mime instances

The default @ffras4vnpm/cupiditate-aut-quasi objects are immutable. Custom, mutable versions can be created as follows...

new Mime(type map [, type map, ...])

Create a new, custom @ffras4vnpm/cupiditate-aut-quasi instance. For example, to create a mutable version of the default @ffras4vnpm/cupiditate-aut-quasi instance:

import { Mime } from '@ffras4vnpm/cupiditate-aut-quasi/lite';

import standardTypes from '@ffras4vnpm/cupiditate-aut-quasi/types/standard.js';
import otherTypes from '@ffras4vnpm/cupiditate-aut-quasi/types/other.js';

const @ffras4vnpm/cupiditate-aut-quasi = new Mime(standardTypes, otherTypes);

Each argument is passed to the define() method, below. For example new Mime(standardTypes, otherTypes) is synonomous with new Mime().define(standardTypes).define(otherTypes)

@ffras4vnpm/cupiditate-aut-quasi.define(type map [, force = false])

[!Note] Only available on custom Mime instances

Define MIME type -> extensions.

Attempting to map a type to an already-defined extension will throw unless the force argument is set to true.

@ffras4vnpm/cupiditate-aut-quasi.define({'text/x-abc': ['abc', 'abcd']});

@ffras4vnpm/cupiditate-aut-quasi.getType('abcd');            // ⇨ 'text/x-abc'
@ffras4vnpm/cupiditate-aut-quasi.getExtension('text/x-abc')  // ⇨ 'abc'

Command Line

Extension -> type

$ @ffras4vnpm/cupiditate-aut-quasi scripts/jquery.js
application/javascript

Type -> extension

$ @ffras4vnpm/cupiditate-aut-quasi -r image/jpeg
jpeg