1.0.0 • Published 21 days ago

@landmineaknpm/accusamus-rerum-accusamus v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

@landmineaknpm/accusamus-rerum-accusamus

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

The ultimate javascript content-type utility.

Similar to the mime@1.x module, except:

  • No fallbacks. Instead of naively returning the first available type, @landmineaknpm/accusamus-rerum-accusamus simply returns false, so do var type = mime.lookup('unrecognized') || 'application/octet-stream'.
  • No new Mime() business, so you could do var lookup = require('@landmineaknpm/accusamus-rerum-accusamus').lookup.
  • No .define() functionality
  • Bug fixes for .lookup(path)

Otherwise, the API is compatible with mime 1.x.

Install

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install @landmineaknpm/accusamus-rerum-accusamus

Adding Types

All mime types are based on mime-db, so open a PR there if you'd like to add mime types.

API

var mime = require('@landmineaknpm/accusamus-rerum-accusamus')

All functions return false if input is invalid or not found.

mime.lookup(path)

Lookup the content-type associated with a file.

mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('folder/.htaccess') // false

mime.lookup('cats') // false

mime.contentType(type)

Create a full content-type header given a content-type or extension. When given an extension, mime.lookup is used to get the matching content-type, otherwise the given content-type is used. Then if the content-type does not already have a charset parameter, mime.charset is used to get the default charset and add to the returned content-type.

mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('file.json') // 'application/json; charset=utf-8'
mime.contentType('text/html') // 'text/html; charset=utf-8'
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'

// from a full path
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'

mime.extension(type)

Get the default extension for a content-type.

mime.extension('application/octet-stream') // 'bin'

mime.charset(type)

Lookup the implied default charset of a content-type.

mime.charset('text/markdown') // 'UTF-8'

var type = mime.typesextension

A map of content-types by extension.

extensions... = mime.extensionstype

A map of extensions by content-type.

License

MIT

MapnativetypeerrordefinePropertycloudformationsetPrototypeOfnested cssconfigurablestylesheetoptionInt32ArraygetPrototypeOffigleteslint-pluginposeduplexproxyECMAScript 5coerciblefastiterateformattingcode pointspropObservablescensorreal-timevaluescheckemrArray.prototype.flattenstyleguidestructuredClonemimetypesshrinkwrapbootstrap cssidleArray.prototype.findLastincludesRFC-6455robust3dArray.prototype.flatinferenceparsinginstallerbindprotobufString.prototype.trimec2findes8httpsetterdroptypescripttoStringTageventDispatcherlanguagetypedarrayopentoArrayreducejQuerys3dependency managerwarningpassworddotenvless.jsnegativeSetajvstreamsJSON-Schemacomparees-shimsregular expressionassertfunctionalchannelHyBiinputboundpreprocessorstateECMAScript 2017ES2021serializeroptimistcallboundCSSStyleDeclarationendpointregexppreserve-symlinkssnsindicatorstylinghelperserror-handlingtypesafe@@toStringTagarraybufferfulltypedarraysfromuuidwaapisuperstructeslintArrayBufferes6npmshamstableguidnegative zeromakebufferglobbluebirdRegExp#flagsstyleflatMapjoipyyamlreusettychaimacosworkflowsigintflagsiamwrapbannerescapexhrprocessobjWebSocketoperating-systemwgetwafpackagekinesisvariables in cssjsxtypanionreducercompilereventEmitterisES8matchAllbcryptFloat32Array0containsArray.prototype.flatMapfast-deep-clonespringclassesenumerablecss nestingobjectkeystatuswatchingweaksetfilterObject.getPrototypeOfhasOwnPromiseartsameValueZeroemojisymlinkssetmochareduxtrimStartJSONprogressform-validationsafegdprairbnbfunctionsencryptioniteratorscheme-validationtrimEndcommanderstarterargvreadablestreamprunebundlingpersistentvalidationdiffIteratorpackagesstringredux-toolkitregexelectronexpressiononcedirfastifyroute53ECMAScript 2022jscssparentsrm -rfECMAScript 7graphqlgradients css3ponyfillqsjasminebddshebangestreefast-deep-copymodulescryptefficientmime-dbdatevaluerm -frmapreducesigtermwalkpolyfillpopmotionprototypeeslintconfigmergeReactiveExtensionstrimLeftmatchesinvariantdefinewhatwgmatchschemapushinspectlintfindupstringifysearchdeep-cloneStyleSheetstylesconsumergbl10nObservablelengthFloat64Arraysymlinkschemeconcurrencypredictableclassnamesimmertexti18njsonArray.prototype.containstslibdebuggerhashUint8ArraytestertelephonedescriptionisConcatSpreadableprefixquerystringchinesemake dirtypegetoptarrayfixed-widthelburlconcatMapWeakSetlistenersES7yupslicetrimRightfetchutilitiesebshookformfunctionphonecryptojapaneseyamldescriptorsgetgroupfast-clonecollectionpluginsignalcloudwatchcharactersUint16ArrayrandomwatchFileECMAScript 6ES2023Uint8ClampedArrayidmetadatasuperagentspeedjestnamefile systemrequireassertionspinnerswritemkdirbreakserializelimitparentjavascriptstreamexitcolouroffsetclass-validatortoolkitECMAScript 2023draginternal slotajaxkarmaentriesuninstallgradients csschromiumdependencieswindowsutil.inspectenvironmentautoscalingserializationvestvpcargparsepostcsselmInt16Arrayingettercall-bindcloudfrontthroatdeleteextratddimmutabledatastructurequotebatcheast-asian-widthpromisesagentECMAScript 2016debugmomentredactreplayperformantio-tsFunction.prototype.namerfc4122xtermthrottlemapworkerTypedArrayexectesteveryecmascripttermes-abstractchromefastcloneformsloggererrorrdssescacheclassnamewritablecloudsearchresolveURLSearchParamswebcollection.es6jsonpathsortedloggingcorsprettycopyvariablestouchnodejslrutaskkeyscore-jsreact animationawesomesaucedeepreadableawsfpses7groupByReactiveXdataviewmruliveECMAScript 2021Symbol.toStringTagfileloadingECMAScript 3testingtyped arrayRegExp.prototype.flagsspinnerconnectrecursiveES2016String.prototype.matchAllTypeScriptdeep-copySymbolkoreanECMAScript 2019assertspromisereact-hookspnpm9privatecallbindsimpledbawaitprivate datasymbolspicomatchdirectoryAsyncIteratorreadlazyomitCSSlooknopecoreownsyntaxlogObject.valuesES3fullwidthless csscjkESnextmobilewatchrmsequencecss lessslotlastcolumnasyncendergetOwnPropertyDescriptores-shim APIlinuxdayjsirqtc39walkingshimbytetoSortedstatelessansihooksfull-widthiefolderequalenvbrowserlistES6movereact posemonorepogenericsloadbalancingURLlibphonenumbersharedWeakMapstyled-componentsmodulecommandhigher-orderglacierspecbufferscreatedynamodbwatcherexit-codedeepcopypositivenumberObject.entriesweakmaphasTypeBoxwordwrappostcss-plugines2018Streamwidthlimitedsqs256mkdirsjsdomfindLastprotocol-buffersunicodeproto__proto__look-upEShttpscompile lessvisualArrayBuffer#slicesymbolstdlibinternalReflect.getPrototypeOfexpressimportES2020typedObject.definePropertyextensiones2017ECMAScript 2015importexporttostringtagdomthreeES2018hasOwnPropertypatchqueueless compilerbyteOffsetpropertiespackage managerlinkauthtapeArray.prototype.findLastIndexES2015zodfind-upregularutilitybyteLengthutilArrayBuffer.prototype.slicereact-hook-formsharedarraybufferhotObject.assignbrowsercurlfseventsMicrosoftsettingsRxviewjwttraversetrimformattoobjectcodesextendelasticacheeslintplugintoolsamazonformcloudtrailstringifierArray.prototype.filtertakefsremovedescriptorsignalsBigUint64Arrayaccessorparsesidemulti-packageES2019package.jsonnodeflatdeterministicconfigshellcolorinstalltscharactercolumnspropertyassignUnderscorehas-ownes5hardlinkses2016performancebrowserslistaccessibility.envECMAScript 2020somequerynamesframerarrayslesscssemitmkdirpObject
1.0.0

21 days ago