8.16.144 • Published 11 months ago

@firanorg/impedit-mollitia-sint v8.16.144

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

Mime

NPM downloads Mime CI

An API for MIME type information.

  • All @firanorg/impedit-mollitia-sint-db types
  • Compact and dependency-free @firanorg/impedit-mollitia-sint's badge
  • Full TS support

!Note @firanorg/impedit-mollitia-sint@4 is now latest. If you're upgrading from @firanorg/impedit-mollitia-sint@3, note the following:

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

Installation

npm install @firanorg/impedit-mollitia-sint

Quick Start

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

import @firanorg/impedit-mollitia-sint from '@firanorg/impedit-mollitia-sint';

@firanorg/impedit-mollitia-sint.getType('txt');                    // ⇨ 'text/plain'
@firanorg/impedit-mollitia-sint.getExtension('text/plain');        // ⇨ 'txt'

Lite Version @firanorg/impedit-mollitia-sint/lite's badge

@firanorg/impedit-mollitia-sint/lite is a drop-in @firanorg/impedit-mollitia-sint replacement, stripped of unofficial ("prs.*", "x-*", "vnd.*") types:

import @firanorg/impedit-mollitia-sint from '@firanorg/impedit-mollitia-sint/lite';

API

@firanorg/impedit-mollitia-sint.getType(pathOrExtension)

Get @firanorg/impedit-mollitia-sint type for the given file path or extension. E.g.

@firanorg/impedit-mollitia-sint.getType('js');             // ⇨ 'application/javascript'
@firanorg/impedit-mollitia-sint.getType('json');           // ⇨ 'application/json'

@firanorg/impedit-mollitia-sint.getType('txt');            // ⇨ 'text/plain'
@firanorg/impedit-mollitia-sint.getType('dir/text.txt');   // ⇨ 'text/plain'
@firanorg/impedit-mollitia-sint.getType('dir\\text.txt');  // ⇨ 'text/plain'
@firanorg/impedit-mollitia-sint.getType('.text.txt');      // ⇨ 'text/plain'
@firanorg/impedit-mollitia-sint.getType('.txt');           // ⇨ 'text/plain'

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

@firanorg/impedit-mollitia-sint.getType('foo/txt');        // ⇨ null
@firanorg/impedit-mollitia-sint.getType('bogus_type');     // ⇨ null

@firanorg/impedit-mollitia-sint.getExtension(type)

Get file extension for the given @firanorg/impedit-mollitia-sint type. Charset options (often included in Content-Type headers) are ignored.

@firanorg/impedit-mollitia-sint.getExtension('text/plain');               // ⇨ 'txt'
@firanorg/impedit-mollitia-sint.getExtension('application/json');         // ⇨ 'json'
@firanorg/impedit-mollitia-sint.getExtension('text/html; charset=utf8');  // ⇨ 'html'

@firanorg/impedit-mollitia-sint.getAllExtensions(type)

!Note New in @firanorg/impedit-mollitia-sint@4

Get all file extensions for the given @firanorg/impedit-mollitia-sint type.

@firanorg/impedit-mollitia-sint.getAllExtensions('image/jpeg'); // ⇨ Set(3) { 'jpeg', 'jpg', 'jpe' }

Custom Mime instances

The default @firanorg/impedit-mollitia-sint objects are immutable. Custom, mutable versions can be created as follows...

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

Create a new, custom @firanorg/impedit-mollitia-sint instance. For example, to create a mutable version of the default @firanorg/impedit-mollitia-sint instance:

import { Mime } from '@firanorg/impedit-mollitia-sint/lite';

import standardTypes from '@firanorg/impedit-mollitia-sint/types/standard.js';
import otherTypes from '@firanorg/impedit-mollitia-sint/types/other.js';

const @firanorg/impedit-mollitia-sint = 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)

@firanorg/impedit-mollitia-sint.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.

@firanorg/impedit-mollitia-sint.define({'text/x-abc': ['abc', 'abcd']});

@firanorg/impedit-mollitia-sint.getType('abcd');            // ⇨ 'text/x-abc'
@firanorg/impedit-mollitia-sint.getExtension('text/x-abc')  // ⇨ 'abc'

Command Line

Extension -> type

$ @firanorg/impedit-mollitia-sint scripts/jquery.js
application/javascript

Type -> extension

$ @firanorg/impedit-mollitia-sint -r image/jpeg
jpeg
metadatapasswordio-tsreal-timeexit-codesortsnspersistentwordbreakassertionappstdlibsortedECMAScript 5SetawstoSortedwatchpropjasminefindupinspectdiffzerobufferstoolkitdependency managerexpressionECMAScript 2019streamWebSocketcloudformationcryptcharactersHyBisetPrototypeOfreadableclassnameString.prototype.matchAlleventDispatchercheckloadbalancingomitasyncfpslookdateECMAScript 2017call-bindwatchFileJSONvestpostcssObject.entriesprettygetteremitwhatwgString.prototype.trimextensionrdsimportparsesafecss lesshooks__proto__glacierkoreandescriptorbeanstalkasciienumerablecss variableECMAScript 3boundbrowsermkdirsratehasOwneslintpluginESnextgroupBydeepisConcatSpreadabletimesearchutil.inspectlintes6jsonprototypefastcopycontainsimmerrouterrmpropertiestypesafeschemelogtypesquotefullartgetintrinsicequalurlutilitiesbusyECMAScript 2015Uint32Arrayprotolockfilesuperstructtestrapidlimitrequestgetoptthrottledebuggervariables in csses8dynamodbReactiveExtensionsmake dirstablestreamsmobilecommandtestermomentlinewrapcolorarktypepositiveflagsmkdirpsequenceES2021flatMapajvcharacterparentrmdirttybluebirdcolourFunction.prototype.nametypees2018taptypanionconfigurableES2019outputconsumepipeswfeslintwritableclassnamessharedreplayserializationenderES2022inMapArrayBuffer#sliceratelimitsesshamtextwatchingstylesUnderscore-0regularprivate dataoffsetcorsroute53BigInt64Arrayfrom0jsxconcurrencyES3findarraysetenvironmentscheme-validationflaginternalhookformsettingsregexsetImmediateflattenautoscalingbrowserlistfsrobusteslintconfigishotuninstalldeep-clonemonorepobdddependenciesreact-hook-formirqa11ycompilerenvoperating-systemjsdiffsignalPushconcatMapes-shimsnpminputclass-validatorquerypushpostcss-pluginargparsemimefullwidthobjectsigtermwordwrapdropconsoleweb.envECMAScript 2018chromebundlingstoragegatewaygetmapelmreactcommanderroutenodestatewrapmimetypesFloat64ArraykeyMicrosoftecmascriptweakmaplibphonenumbertrimRighttypeofserializervariablesES7escapepackagesgenericsRegExp#flagsmapreducevisualpackagelimitedprotobufbannernativedatastructurehandlersarraysdayjsECMAScript 6styleguidemixinslistenersRxJSformatidtakestringifycompile lessfindLastIndexcolumnsmatchArray.prototype.flatassertsdefinetddjssymbolfast-copyprotocol-buffersjestsimpledbes2015extendRegExp.prototype.flagsperformancehas-ownbyteOffsetstatelessebsbytecryptomatchesfile systemtapehasOwnPropertymkdirpromisesredux-toolkitfunctionalObject.fromEntriessomeES5full-widthspinnersexeceast-asian-widthworker
8.16.144

11 months ago

8.16.143

11 months ago

8.16.142

11 months ago

8.15.126

11 months ago

8.15.128

11 months ago

8.15.127

11 months ago

8.15.129

11 months ago

8.16.141

11 months ago

8.16.140

11 months ago

8.16.138

11 months ago

8.16.137

11 months ago

8.16.136

11 months ago

8.16.135

11 months ago

8.16.139

11 months ago

8.15.131

11 months ago

8.15.130

11 months ago

8.14.126

11 months ago

8.16.134

11 months ago

8.16.133

11 months ago

8.16.132

11 months ago

8.16.131

11 months ago

8.14.125

11 months ago

8.14.124

11 months ago

8.14.123

11 months ago

8.14.122

12 months ago

8.14.121

12 months ago

8.14.119

12 months ago

8.14.118

12 months ago

8.14.117

12 months ago

8.14.116

12 months ago

8.14.120

12 months ago

7.14.115

12 months ago

7.14.116

12 months ago

7.14.114

12 months ago

7.14.113

12 months ago

7.14.112

12 months ago

6.14.110

12 months ago

6.14.112

12 months ago

6.14.111

12 months ago

6.14.109

12 months ago

6.14.107

12 months ago

6.14.108

12 months ago

5.14.107

12 months ago

4.14.107

12 months ago

4.14.106

1 year ago

4.14.105

1 year ago

4.14.104

1 year ago

4.14.103

1 year ago

4.13.103

1 year ago

4.13.102

1 year ago

4.13.101

1 year ago

3.6.63

1 year ago

4.8.67

1 year ago

4.8.69

1 year ago

4.8.68

1 year ago

2.5.47

1 year ago

2.3.24

1 year ago

2.5.48

1 year ago

2.3.23

1 year ago

2.5.49

1 year ago

2.3.25

1 year ago

3.6.62

1 year ago

2.5.43

1 year ago

3.6.61

1 year ago

2.5.44

1 year ago

3.6.60

1 year ago

2.5.45

1 year ago

2.3.22

1 year ago

2.5.46

1 year ago

2.3.21

1 year ago

4.12.99

1 year ago

4.12.98

1 year ago

4.10.77

1 year ago

4.12.97

1 year ago

4.10.78

1 year ago

4.12.96

1 year ago

4.12.91

1 year ago

4.12.90

1 year ago

4.12.95

1 year ago

2.5.50

1 year ago

4.12.94

1 year ago

4.12.93

1 year ago

4.12.92

1 year ago

3.8.67

1 year ago

3.8.65

1 year ago

4.12.89

1 year ago

3.8.66

1 year ago

3.8.64

1 year ago

3.6.59

1 year ago

3.6.58

1 year ago

3.6.57

1 year ago

4.8.70

1 year ago

4.8.72

1 year ago

4.8.71

1 year ago

4.8.73

1 year ago

2.4.29

1 year ago

2.4.28

1 year ago

2.4.25

1 year ago

2.4.27

1 year ago

2.4.26

1 year ago

4.13.100

1 year ago

2.6.50

1 year ago

4.9.73

1 year ago

4.9.75

1 year ago

4.9.74

1 year ago

4.9.77

1 year ago

4.9.76

1 year ago

2.4.39

1 year ago

2.4.36

1 year ago

2.4.35

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

2.6.55

1 year ago

2.4.32

1 year ago

2.6.56

1 year ago

2.4.31

1 year ago

2.6.57

1 year ago

2.4.34

1 year ago

2.4.33

1 year ago

2.6.51

1 year ago

1.3.17

1 year ago

2.6.52

1 year ago

1.3.18

1 year ago

2.6.53

1 year ago

2.4.30

1 year ago

2.6.54

1 year ago

4.11.87

1 year ago

4.11.86

1 year ago

4.11.85

1 year ago

1.3.19

1 year ago

4.11.84

1 year ago

4.11.89

1 year ago

4.11.88

1 year ago

1.3.20

1 year ago

1.3.21

1 year ago

2.4.43

1 year ago

2.4.42

1 year ago

4.11.83

1 year ago

4.11.82

1 year ago

4.11.81

1 year ago

2.4.41

1 year ago

4.11.80

1 year ago

2.4.40

1 year ago

4.13.99

1 year ago

4.11.79

1 year ago

4.11.78

1 year ago

3.7.64

1 year ago

3.7.63

1 year ago

1.3.16

1 year ago

1.2.13

1 year ago

1.3.15

1 year ago

1.2.14

1 year ago

1.2.15

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

1 year ago

1.0.7

1 year ago

1.0.6

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