1.0.22 • Published 1 year ago

@devtea2027/laborum-dolor-doloribus-et v1.0.22

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

@devtea2027/laborum-dolor-doloribus-et

NPM npm

The @devtea2027/laborum-dolor-doloribus-et is a tiny library that could convert file to arraybuffer, dataUrl and text

Intall

npm i @devtea2027/laborum-dolor-doloribus-et -S

or

pnpm add @devtea2027/laborum-dolor-doloribus-et -S

Useage

Here is a simple demo.

import { toAny } from "@devtea2027/laborum-dolor-doloribus-et";

// You can get file by input tag with type that is file
toAny(file, "arrayBuffer").then((value) => {
  console.log(value); // value is a arrayBuffer
});

API

toAny

The all-purpose api to convert file to others.

  • Params
    • file Blob | File The file to convert.
    • options "arrayBuffer" | "dataUrl" | "objectUrl" | "text" | object
      • options.type "arrayBuffer" | "dataUrl" | "objectUrl" | | "text"
      • options.encoding "string" | undefined Only used for "text"
  • Returns
    • Promise<any> Returns the associated result according to the specified parameter.

toBinaryString

Convert file to binaryString.

  • Params
    • file Blob | File The file to convert.
    • Returns
      • Promise<string> Returns a binaryString.

toArrayBuffer

Convert file to arrayBuffer.

  • Params
    • file Blob | File The file to convert.
    • Returns
      • Promise<ArrayBuffer> Returns a arrayBuffer.

toDataUrl

Convert file to dataUrl.

  • Params
    • file Blob | File The file to convert.
    • Returns
      • Promise<string> Returns a dataUrl.

toObjectUrl

Convert file to objectUrl.

  • Params
    • file Blob | File The file to convert.
    • Returns
      • Promise<string> Returns a objectUrl.

toText

Convert file to string.

  • Params
    • file Blob | File The file to convert.
    • encoding "string" | undefined Encoding type.
    • Returns
      • Promise<string> Returns a string.
superstructdataViewbyteLengthrmglaciercolourESconfigeventDispatcherconcurrencypicomatchjQueryexecutableshimargsES8CSSiterationmkdirsregular expressionsInt8ArrayesassertURLdescriptionwordwrapwritabletrimLeftcall-bindstructuredClonedependenciesconnectkeylengthfile systemrfc4122childrgbartshrinkwrapformatbrowserlistfluxSymbolmkdirplesscsspnpm9calldayjsurlspreprocessorObject.valuesdataviewsigtermdefineoutputglobalsvarsloggercharactersfunctionES2019multi-packagereactwindowsa11yReactiveExtensionspromisesexit-codeinferenceassigntapspinnerFunction.prototype.namepathemrsesgdprECMAScript 2017awselmirqbuffersJSONArray.prototype.flatMaptermequalityutil.inspectwgetthroathooksparentidleassertionprotocol-bufferssequencextermes5predictableenvironmentconsumeES5writereact-testing-librarymkdirwarningmobilecreatetypeoflockfilehashjasminepipeunicodecore-jsthrottleWeakSetregexdateprunenodeautoscalingeslintconfigqueueflagairbnbdeepes2018bootstrap lessdifftouchprivatepersistentmetadataes8yupoffsetremoveerrorRxJSregular expressionpackageSymbol.toStringTagcheckstoragegatewaysettingsimmerextensionsimpledblibphonenumberflatMapclassesgetintrinsicconfigurabledirMaphotArray.prototype.findLastIndexlanguageECMAScript 2021typestylesendpointassertsparentsapipasswordoptimizercode pointsES2023expressHyBies7recursivepatchtc39toStringTagstreamlazyreadablesqsgradients cssinputclonepushcollection.es6Array.prototype.includesarraybufferencryptiontoobjectenvironmentssignaldebugi18nfromvariablesAsyncIteratordefinePropertyeslintpluginbindtoArrayECMAScript 3symlinksintrinsicflattenindicatoransicachefull-widthownfast-copyStreamseast-asian-widthnegativefastcensorvariables in cssmapreducees-shimsstartWebSocketsperformanceajaxless compilersharedarraybufferRegExp.prototype.flagsemitdeepcopyajvdefaultruntimees2016workspace:*Object.fromEntrieswaittypedcallbindwatchingmapreact-hooksmake direcmascriptES2016ec2eslint-pluginquoteglobalsymbolsrm -frquerystringmatchlookidentifiersObject.definePropertylessoncechannelshebanghttpshandlersreducerminimallogPushcommander@@toStringTagfetchincludescss variablecompile lesspostcssdebuggerreduxgetOwnPropertyDescriptorsnsWebSocketpropertiesrm -rffastifylistenersString.prototype.trimdeepclonefullwidthfigletcurlURLSearchParamsECMAScript 7circular-0256pluginmrusomelivejshintSetworkerclassnamesstatusgroupBypackagesamazonargumentserror-handlingcss-in-jsrestfuljapanesetoolsrouterredux-toolkitutilitywaftakechromiumString.prototype.matchAllomitmimetypesmonorepoqsnested csswebTypedArraycollectionexpressionjwtvaluetypeerrorcompareloggingphonecryptpackage.jsontrimStartavaefficientjsonpathsetnameslrureadablestreamclass-validatores-shim APItaskspinnerses2015promisecoerciblewrapshareddom-testing-librarybundlingqueueMicrotaskagentresolvewatcherObject.getPrototypeOfstylebyteOffsetprotobrowserslistarrayarraystypedarrayschemaenvCSSStyleDeclarationArrayBuffer.prototype.slicecall-boundfilterauthenticationiteratorcloudformationIteratorscheme-validationflatglobInt16ArrayjavascriptreadserializationprototypexhrsameValueZerofastcopyopensES2020package managermatchesebsECMAScript 2015Array.prototype.containssyntaxpropertyfindLastuuidcloudwatchbytedirectorystarterwhatwgtddchromexdg-opennpmfindObject.keysroute53fsES2018texttimetypedarraysfunctionalcloudtraildropsuperagentstylesheetcryptolinkjsdiffhardlinksinstallertapeless csshttpES2017moveES7regexpzodjsonimportflagsmomentcolumnsquerybreakrequestUint8ClampedArraycallbackconcatfpsdatayamlcjknodejsentriesfindLastIndexArraystylingtrimRightwordbreakjoidynamodbECMAScript 2019asciinativecssmodulesutilYAMLlinewrapBigInt64Arraymime-dbslicemakecharacter__proto__deep-cloneECMAScript 2018iewalkgradients css3serializergroupbddconcatMapless mixinsUnderscorechaiweakmapmixinsObservableoperating-systemArray.prototype.filterguidhashas-ownreal-timeviewspeedmimenopeaccessor[[Prototype]]computed-typesmiddlewarekinesisinstalloptionrandomjsbufferes2017lastexeObjectrequireBigUint64Arrayprefixmergedeep-copytsargumentpostcss-pluginreduceECMAScript 2022css lessArray.prototype.flattencompilerrangeerrorkarmastyled-componentstrimEndvpchasOwncontainsterminalsetImmediatebatchupcommandshamUint16ArrayprettyoptimistbannerReactiveXforEachutilitiesECMAScript 2016telephoneFloat64Arrayuninstalleditoreventslinuxwalkinglimitedstabletslibserializewhichprivate dataECMAScript 6zeroPromisebootstrap cssperformantformattingbundlerfind-upponyfillfileweaksetimportexportcolumnfixed-widtheslintclassnamereusefast-deep-copyvisualmatchAllArray.prototype.findLastexitsetter0openerRegExp#flagsrobustshellReflect.getPrototypeOftyped arrayslotdotenvelectronObject.isES6deleteparsingform-validationeventEmitterstringifiervalidES2021consoledomESnextfast-cloneinterruptsObject.assignproxyArrayBuffer#slicearktypeiteratemochainspectextrajestUint32ArrayMicrosoftstdlibsortedidcodesprocessFloat32Arrayjsdom
1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

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