2.2.19 • Published 1 year ago

@devtea2027/reiciendis-laboriosam-maxime-excepturi v2.2.19

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Mime

NPM downloads Mime CI

An API for MIME type information.

  • All @devtea2027/reiciendis-laboriosam-maxime-excepturi-db types
  • Compact and dependency-free @devtea2027/reiciendis-laboriosam-maxime-excepturi's badge
  • Full TS support

!Note @devtea2027/reiciendis-laboriosam-maxime-excepturi@4 is now latest. If you're upgrading from @devtea2027/reiciendis-laboriosam-maxime-excepturi@3, note the following:

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

Installation

npm install @devtea2027/reiciendis-laboriosam-maxime-excepturi

Quick Start

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

import @devtea2027/reiciendis-laboriosam-maxime-excepturi from '@devtea2027/reiciendis-laboriosam-maxime-excepturi';

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('txt');                    // ⇨ 'text/plain'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension('text/plain');        // ⇨ 'txt'

Lite Version @devtea2027/reiciendis-laboriosam-maxime-excepturi/lite's badge

@devtea2027/reiciendis-laboriosam-maxime-excepturi/lite is a drop-in @devtea2027/reiciendis-laboriosam-maxime-excepturi replacement, stripped of unofficial ("prs.*", "x-*", "vnd.*") types:

import @devtea2027/reiciendis-laboriosam-maxime-excepturi from '@devtea2027/reiciendis-laboriosam-maxime-excepturi/lite';

API

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType(pathOrExtension)

Get @devtea2027/reiciendis-laboriosam-maxime-excepturi type for the given file path or extension. E.g.

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('js');             // ⇨ 'application/javascript'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('json');           // ⇨ 'application/json'

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('txt');            // ⇨ 'text/plain'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('dir/text.txt');   // ⇨ 'text/plain'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('dir\\text.txt');  // ⇨ 'text/plain'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('.text.txt');      // ⇨ 'text/plain'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('.txt');           // ⇨ 'text/plain'

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

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('foo/txt');        // ⇨ null
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('bogus_type');     // ⇨ null

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension(type)

Get file extension for the given @devtea2027/reiciendis-laboriosam-maxime-excepturi type. Charset options (often included in Content-Type headers) are ignored.

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension('text/plain');               // ⇨ 'txt'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension('application/json');         // ⇨ 'json'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension('text/html; charset=utf8');  // ⇨ 'html'

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getAllExtensions(type)

!Note New in @devtea2027/reiciendis-laboriosam-maxime-excepturi@4

Get all file extensions for the given @devtea2027/reiciendis-laboriosam-maxime-excepturi type.

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getAllExtensions('image/jpeg'); // ⇨ Set(3) { 'jpeg', 'jpg', 'jpe' }

Custom Mime instances

The default @devtea2027/reiciendis-laboriosam-maxime-excepturi objects are immutable. Custom, mutable versions can be created as follows...

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

Create a new, custom @devtea2027/reiciendis-laboriosam-maxime-excepturi instance. For example, to create a mutable version of the default @devtea2027/reiciendis-laboriosam-maxime-excepturi instance:

import { Mime } from '@devtea2027/reiciendis-laboriosam-maxime-excepturi/lite';

import standardTypes from '@devtea2027/reiciendis-laboriosam-maxime-excepturi/types/standard.js';
import otherTypes from '@devtea2027/reiciendis-laboriosam-maxime-excepturi/types/other.js';

const @devtea2027/reiciendis-laboriosam-maxime-excepturi = 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)

@devtea2027/reiciendis-laboriosam-maxime-excepturi.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.

@devtea2027/reiciendis-laboriosam-maxime-excepturi.define({'text/x-abc': ['abc', 'abcd']});

@devtea2027/reiciendis-laboriosam-maxime-excepturi.getType('abcd');            // ⇨ 'text/x-abc'
@devtea2027/reiciendis-laboriosam-maxime-excepturi.getExtension('text/x-abc')  // ⇨ 'abc'

Command Line

Extension -> type

$ @devtea2027/reiciendis-laboriosam-maxime-excepturi scripts/jquery.js
application/javascript

Type -> extension

$ @devtea2027/reiciendis-laboriosam-maxime-excepturi -r image/jpeg
jpeg
typeerrorajvPushawscore-jsInt32ArrayprettyjshintisConcatSpreadableenumerableeslintconfigagentwalksignalsObject.valuesjwtefficienterrormimesetImmediatejapaneseHyBilookhandlersvestsigintsetsequencedeepcopykoreanirqnope0cloudfrontcryptoprototypeObjectbundler-0promisesxdg-openaccessorwatchbrowserlistguidvalidationtimedebuggertc39shimmulti-packagewhichcoreecmascriptinspectsqsforEachObject.definePropertycloudwatchsyntaxerrorchildjQueryyamlsetterassigncss-in-jsincludesstylingweakmapoffsetsymlinkscolorboundapploadbalancingbyteLengthvalidclisymbolstructuredCloneECMAScript 2018qscheckes-shimsArray.prototype.flattenAsyncIteratortakefastcopyec2cloudsearchObservablenameexpressioncodesjsdomsignaldependenciesflatmkdirsentriesconcurrencystylesbluebirdargvBigInt64ArrayrangeerrorhasOwnwaitcompilerlintconfigutilownarktypefull-widthurlfind-upcallbackdatereal-timefile systemterminaloptimistfastcloneFloat64ArraytaprandomWeakMapStreamssameValueZeropackagescreateeveryutilitiestesterduplexglobalmergefpsdrop__proto__commanderenvironmentswatchFilematchesregular expressionsSymbolgetPrototypeOfReflect.getPrototypeOfwgetUint16Arrayestreecss lessES2015numberurlsinstallerES2020reducefunctionalInt8ArrayprivatetermlibphonenumberkeypipemoverouterInt16Arrayassertsawaitdeep-clonefromsuperstructobjutil.inspectWeakSetbuffermatchfast-clonefindLastIndexstringifyes-shim APIArrayBuffer#sliceconfigurablepatchpostcssregular expressiondeterministicdynamodbfigletES2023livetoolsidentifiersdatastructurepersistenteslintrequestkeyscall-bindproptslibsortedes5hashuninstallconsoledefinergbiteratetypedlinewraphotreadablestreamfluxtrimRighti18nECMAScript 2022modulesnssymbolsES6collectionECMAScript 2016byteArrayBufferfast-deep-clonemobileES3rateyupmatchAllstyled-componentsimmutableexegetteraccessibilityObject.getPrototypeOfexecutableES2017optimizertoStringTagchromeRFC-6455ES2016eventEmitterlogbyteOffsetflagsviewupMicrosoftunicodeeventDispatcherreactredactexeceast-asian-widthpolyfillslotpruneredux-toolkitcopyexit-codedom-testing-librarylimitansibufferspicomatchRegExp.prototype.flagsxhrcolorsparseprocessqueueMicrotasknpmtestingregexfast-deep-copystableObservableschromiummapreduce.envprotobufbeanstalkdependency managerpropertyformattingpredictablegetintrinsicargumentlanguagecollection.es6parentspackagevariables in cssquerypostcss-pluginprogresscontainsstdlibes2015ECMAScript 2021reuseString.prototype.trimCSSremoveloadingbusystyleio-tscharacterstypesargumentstypanionchinesecmdiegdprgroupless.jscurlrdsmomentpropertiesECMAScript 7trimStartwatchercloneframeworkdeepclonecode pointsastdescriptormakestylesheetopenObject.keysregular$.extendhas-ownqueueomitsortclassnamees2018zodeslintpluginIteratorsuperagentidlehttpsdefinePropertystatelessphoneindicatorES2018_.extendObject.entrieslinuxpackage managertoArraynegative zeroRxURLSearchParamsArraydatachaies7hardlinkscolumntraversecensorerror-handlingreact-testing-libraryhooksthrottlebrowserslistglobdefaultrapidexpresscircularjasminermdirstoragegatewayinputfindLastworkflowroute53amazonassertObject.isflatMapemojiloggingoptionfseventsebscacheexitRxJSgetArray.prototype.flatenderreact-hooksvpcES5Object.fromEntriesschemacallboundcssTypeScriptECMAScript 2019dataviewArrayBuffer.prototype.slicecorsArray.prototype.findLastIndexregexpbundlingmonoreporfc4122ECMAScript 2015typed arraycharacterfunctioncomparemochaArray.prototype.includeswrapmiddlewarermreadspinnerchannellockfileperformantdescriptorsreact-hook-form@@toStringTagcoercibleendpointcommand-lineconnectmrupreserve-symlinksECMAScript 2023mime-dbjsxiterationpromisevariablesschemeclass-validatortypeofshelltypescriptpyyamlhasOwnPropertyprivate datafunctionsxdgArray.prototype.containsinternal slotlasttrimLeftES8parsingjssharedarraybufferdomhelpersruntimeserializationreducercomputed-typescryptinterruptsgetoptsestypedarraysreduxgradients css3telephonecloudformationwarningtrimEndflattenES2022[[Prototype]]PromiseintestgroupByhttpistoobjectless cssencryptionsharedfolderstyleguideMapReactiveXfastifyWebSocketpasswordspecnested cssserializerextraparserstartdiffmodulesjsonpathESstarterwidthformses2016trimformattypesafepluginUint8ArrayES2019taskstatebrowserautoprefixerSymbol.toStringTagarrayscjkconcatMapes8equalelbformYAMLmacosxtermvaluedeepECMAScript 2020authenticationFunction.prototype.nameimmerflagreadableReactiveExtensionsttyobjectsinatrastringifiersafeautoscalingspinnerscss variablewafemravafullperformancespawnsettingsmetadatal10nfullwidthshamargswebwordwrapeslint-pluginjsonnodewindowsgetOwnPropertyDescriptorwebsiteString.prototype.matchAllstreams2URLdirdescriptionjoilruzeroonceimportmake dirpackage.json256mkdirlazyfsponyfillbatchminimalstreamsless mixinstypecallloggeres6bddObject.assignjavascriptkarmaarraywritablenodejstoolkitsetPrototypeOfasciiless compilersymlinkdataViewESnextpreprocessora11yspeedesairbnbcloudtrailsearchfileassertionRegExp#flagsvarsFloat32Arraycallbindconcatdirectoryextenddayjsglobalsclassnameslimiteddeep-copycolumnsglacierratelimitES7emitkinesissomeArray.prototype.filterjestsyntaxlesspnpm9intrinsicasyncECMAScript 3typedarrayfindwalkingrecursivesimpledbcommandapistatusrm -rfquerystringuuidbannertostringtagTypeBoxform-validationrestdeletenegativeinternalclassesprotocol-buffersprefixlaunchgradients csses-abstractnativeeditorpushhasworkspace:*lengthreplayCSSStyleDeclarationes2017shrinkwrapUnderscoreinferencedebugtoSortedquotebootstrap cssstreampathlinkelasticachevalidateelmopenscall-boundawesomesaucethroatUint32ArrayJSON-SchemaJSONWebSocketsresolvemkdirpfixed-widthimportexportrm -frshebangartinstallrobustrequireECMAScript 5hookformtextSetnamesutilityiaminvariantmimetypeswatchingopeneridscheme-validationES2021writerestfulparentweaksetdotenvfiltercss nestingworkercolourUint8ClampedArrayslicepositiveserializevisualescapeconsumeequalityelectronlistenerss3lesscssbreakvaluesjsdiffArray.prototype.findLastenvprotofast-copywhatwgbootstrap lessfastwordbreaktapestringiteratorhigher-orderBigUint64ArraytsswfmapextensionbindgenericsfindupajaxECMAScript 2017argparseoperating-systemcompile lessArray.prototype.flatMapfetchmixinsTypedArrayStyleSheetproxyarraybuffereventssigterm
2.2.19

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.16

1 year ago

1.2.16

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago