4.7.99 • Published 10 months ago

@diotoborg/facilis-totam-atque v4.7.99

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Mime

NPM downloads Mime CI

An API for MIME type information.

  • All @diotoborg/facilis-totam-atque-db types
  • Compact and dependency-free @diotoborg/facilis-totam-atque's badge
  • Full TS support

!Note @diotoborg/facilis-totam-atque@4 is now latest. If you're upgrading from @diotoborg/facilis-totam-atque@3, note the following:

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

Installation

npm install @diotoborg/facilis-totam-atque

Quick Start

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

import @diotoborg/facilis-totam-atque from '@diotoborg/facilis-totam-atque';

@diotoborg/facilis-totam-atque.getType('txt');                    // ⇨ 'text/plain'
@diotoborg/facilis-totam-atque.getExtension('text/plain');        // ⇨ 'txt'

Lite Version @diotoborg/facilis-totam-atque/lite's badge

@diotoborg/facilis-totam-atque/lite is a drop-in @diotoborg/facilis-totam-atque replacement, stripped of unofficial ("prs.*", "x-*", "vnd.*") types:

import @diotoborg/facilis-totam-atque from '@diotoborg/facilis-totam-atque/lite';

API

@diotoborg/facilis-totam-atque.getType(pathOrExtension)

Get @diotoborg/facilis-totam-atque type for the given file path or extension. E.g.

@diotoborg/facilis-totam-atque.getType('js');             // ⇨ 'text/javascript'
@diotoborg/facilis-totam-atque.getType('json');           // ⇨ 'application/json'

@diotoborg/facilis-totam-atque.getType('txt');            // ⇨ 'text/plain'
@diotoborg/facilis-totam-atque.getType('dir/text.txt');   // ⇨ 'text/plain'
@diotoborg/facilis-totam-atque.getType('dir\\text.txt');  // ⇨ 'text/plain'
@diotoborg/facilis-totam-atque.getType('.text.txt');      // ⇨ 'text/plain'
@diotoborg/facilis-totam-atque.getType('.txt');           // ⇨ 'text/plain'

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

@diotoborg/facilis-totam-atque.getType('foo/txt');        // ⇨ null
@diotoborg/facilis-totam-atque.getType('bogus_type');     // ⇨ null

@diotoborg/facilis-totam-atque.getExtension(type)

Get file extension for the given @diotoborg/facilis-totam-atque type. Charset options (often included in Content-Type headers) are ignored.

@diotoborg/facilis-totam-atque.getExtension('text/plain');               // ⇨ 'txt'
@diotoborg/facilis-totam-atque.getExtension('application/json');         // ⇨ 'json'
@diotoborg/facilis-totam-atque.getExtension('text/html; charset=utf8');  // ⇨ 'html'

@diotoborg/facilis-totam-atque.getAllExtensions(type)

!Note New in @diotoborg/facilis-totam-atque@4

Get all file extensions for the given @diotoborg/facilis-totam-atque type.

@diotoborg/facilis-totam-atque.getAllExtensions('image/jpeg'); // ⇨ Set(3) { 'jpeg', 'jpg', 'jpe' }

Custom Mime instances

The default @diotoborg/facilis-totam-atque objects are immutable. Custom, mutable versions can be created as follows...

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

Create a new, custom @diotoborg/facilis-totam-atque instance. For example, to create a mutable version of the default @diotoborg/facilis-totam-atque instance:

import { Mime } from '@diotoborg/facilis-totam-atque/lite';

import standardTypes from '@diotoborg/facilis-totam-atque/types/standard.js';
import otherTypes from '@diotoborg/facilis-totam-atque/types/other.js';

const @diotoborg/facilis-totam-atque = 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)

@diotoborg/facilis-totam-atque.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.

@diotoborg/facilis-totam-atque.define({'text/x-abc': ['abc', 'abcd']});

@diotoborg/facilis-totam-atque.getType('abcd');            // ⇨ 'text/x-abc'
@diotoborg/facilis-totam-atque.getExtension('text/x-abc')  // ⇨ 'abc'

Command Line

Extension -> type

$ @diotoborg/facilis-totam-atque scripts/jquery.js
text/javascript

Type -> extension

$ @diotoborg/facilis-totam-atque -r image/jpeg
jpeg
validatemapreducepropertywhatwges2015arraysimpledbio-tstypesfnmatchObjectSymbol.toStringTagstoragegatewaycommandforkponyfillerrorsort__proto__picomatchequality.envartsetfiltercall-boundroutingpipeexecmkdirpcallsomefindbyteLengthes2017equalnested cssdefinefast-deep-copyxhrdependenciesloadbalancingECMAScript 2023pluginless csschaihookformrouteStreamstslibkoreanglobal this valueunicodeeventDispatcherObject.isbusyargumenthardlinksSymbollistenerssharedsymbolredux-toolkitjQueryproppushassertArray.prototype.findLastIndexECMAScript 3stringdefinePropertyisConcatSpreadablefpsomitprettyjavascriptsymlinksECMAScript 2020ES2019managerReflect.getPrototypeOfwaapiObject.fromEntriesdeep-cloneschemevariettyanimationautoscalingprivatecacheintrinsicspeedoutputreact-hookscolorsinstallergroupes7randomhasOwnbinglobalThissignedmkdirarraybufferprefixArrayBuffer#slicematchAllmake dirframerRegExp.prototype.flagsnodebootstrap cssinvarianthasOwnPropertytoStringTagemrES6dataViewvalidcoercibleswfchecksetterexecfileimmerhttpsgdprpureclientvaluesqsautoprefixermergeec2installxtermdomWebSocketsbuffersES2017css variablenpmtranspilerObject.valuestrimLeftInt16ArrayclassnamelinttypescriptMaptypeerrorfunctionsReactiveExtensionsshrinkwrap256TypedArrayECMAScriptsuperagentfunction.lengthObservablesfptestingvalidationconcatMapjsonschemauninstallzodtimecollection.es6objsequenceserializeutilityjestfilemodulestoReversedrdsasyncinrfc9562i18nzeroselfshambytevisualchromium@@toStringTagstringifierfasteses-abstractformprotobufforEachpinoentriesyupreversenamecharactersharedarraybuffertyped arraycomputed-typesconsumesuperstructstyled-componentsarktypelocalphonetransportiterationflagclassnamesreadnativemonorepoletPromisereal-timeES2021rfc4122core-jsajaxmapimportcloudformationflattencloudsearchvariablescirculartranspileYAMLObject.assigndeterministicoperating-systemastless mixinsbcryptiamdiffamazonnopereadableacornes2018east-asian-widthdeepcloneESnextECMAScript 2022Array.prototype.findLastpackage.jsonserializationeventEmitterfigletHyBidom-testing-libraryreduxglobal objectcloudtrailreversedoptimizerdescriptionuploadtesterdatastructureprivate datatc39envMicrosoftapolloinferencecssstablelinkvarsES2015boundCSSStyleDeclarationIteratorbeanstalkshellECMAScript 6functionaljsrangeerrornpmignoreArrayBufferhashreadablestreamtoArrayes-shim APIjsdomposehttpshebangcopyspinnersurlenumerablegradients css3banneraccessorbyteOffsetsymlinkcollectionignorenamesstreamses5toolkitguidebssettingsnegativesymbolssyntaxjsdiffreact-componentspringecmascriptcallboundpackage managerexpress3dparserObject.definePropertyjson-schema-validatorbinariesjsonhooksbddregulareffect-tsObject.keysfullwidthencryptionrapiduser-streamsUint8ClampedArrayES3functioncss less6to5workerdirschemaargsiteratoreslintpluginwarningcallbackstylebrowsergettervestagenttrimRighteslint-plugincompareterminalfastcloneUnderscoreparsingproxychanneldeepES2023react-testing-libraryURLSearchParamspyyamlredactmomentdragfspackagesform-validationgetPrototypeOfpreserve-symlinks_.extendeslintnegative zerocss nestingES2018cjksnsBigInt64ArrayoptionFloat64ArraystarterPushES2022binarydynamodbquoteStreamtsownhelpersArray.prototype.flatMapexitBigUint64ArraysubprocesswaitformsES5authcolourAsyncIteratorgroupByassignperformantclasseseslintconfigUint16Arrayfantasy-landuuidlrucall-bindfast-clonemobilecontainsstylesheetruntimechrometyperegular expressionInt8Arraypreprocessores6fast-copycolumnsloggerutiljoicommanderharmonystyleguideString.prototype.matchAllextraqsdotenvECMAScript 5typanionpersistenttextairbnbparsestatelessArray.prototype.filtereventsglobelbpoint-freehas-ownpostcss-plugintypesafetermassertionrequestwriteexecuteroute53movevalidatormacosgetflagswafObservableconfigjshinthascodesdeep-copyidlemulti-packageWeakMapisqueuespawnobjectweaksetURLwritablewindowspropertiestoobjectassertssigintArray.prototype.flattenmetadatamatchesfetchprogressECMAScript 2015telephonehelperlinuxReactiveXFunction.prototype.namelessconfigurabletraverserequiremruprunereducerstatusendpointTypeScriptRxJSbootstrap lessminimalerror-handlinga11yRxObject.getPrototypeOffixed-widthdeepcopycoredeleteTypeBoxloadingfindLastIndexArray.prototype.containsRegExp#flagsdropawsdependency managerUint8Arraywindowgradients cssfull-widthimportexportemitperformancecss-in-jsconcatfastifyjsxeveryelectronexpressionansiflatregexSystem.globalECMAScript 2018Uint32ArraypopmotionbabelsyntaxerrorStyleSheetprotocol-buffersincludesvaluespolyfillindicatorlogcurriedwidthpromisemixinsextendpositivelibphonenumberglobalcryptoclikinesismodulematchqueueMicrotaskpathreactreact-hook-formcloudfrontES2020CSSshimspecfullstylingreact animationArraytypeddataviewapiglobalschildprototypehotsliceyamlpatchArray.prototype.includescolumngenericspnpm9queryinternal slotcertificatesString.prototype.trim
4.7.99

10 months ago

4.6.99

10 months ago

4.6.98

10 months ago

4.6.97

10 months ago

4.6.96

10 months ago

4.6.95

10 months ago

4.6.94

10 months ago

4.6.93

10 months ago

4.6.92

10 months ago

4.6.91

10 months ago

4.6.90

10 months ago

3.6.90

10 months ago

3.6.89

10 months ago

3.6.88

10 months ago

3.6.87

10 months ago

3.6.86

10 months ago

3.6.85

10 months ago

3.6.84

10 months ago

3.5.84

10 months ago

3.5.83

10 months ago

3.5.82

11 months ago

3.5.81

11 months ago

3.5.80

11 months ago

3.5.79

11 months ago

3.5.78

11 months ago

3.5.77

11 months ago

3.5.76

11 months ago

3.5.75

11 months ago

3.5.74

11 months ago

3.4.74

11 months ago

3.4.73

11 months ago

3.4.72

11 months ago

3.4.71

11 months ago

3.4.70

11 months ago

2.4.70

11 months ago

2.4.69

11 months ago

2.4.68

11 months ago

2.4.67

11 months ago

2.4.66

11 months ago

2.4.65

11 months ago

2.4.64

11 months ago

2.4.63

11 months ago

2.4.62

11 months ago

2.4.61

11 months ago

2.4.60

11 months ago

2.4.59

11 months ago

2.4.58

11 months ago

2.4.57

11 months ago

2.4.56

11 months ago

2.4.55

11 months ago

2.4.54

12 months ago

2.4.53

12 months ago

2.4.52

12 months ago

2.4.51

12 months ago

2.4.50

12 months ago

2.4.49

12 months ago

2.3.49

12 months ago

2.2.49

12 months ago

2.2.48

12 months ago

2.2.47

12 months ago

2.2.46

12 months ago

2.2.45

12 months ago

2.2.44

12 months ago

2.2.43

12 months ago

2.2.42

12 months ago

1.2.42

12 months ago

1.2.41

12 months ago

1.2.40

12 months ago

1.1.40

12 months ago

1.1.39

12 months ago

1.1.38

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.35

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.30

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

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.1.6

1 year ago

1.1.5

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago