1.0.0 • Published 1 year ago

@rabiepenpm/eveniet-quas-porro v1.0.0

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

ProtoMini

ProtoMini Logo

npm version Build Status License: MIT

Description

Minimize and optimize your network packets for optimal speed and efficiency with ProtoMini.

Features

  • šŸš€ Fast encoding and decoding
  • šŸ“¦ Simple API
  • šŸ›  TypeScript support
  • šŸŽ® Perfect for real-time game development
  • 🌐 Minimize network latency

Installation

npm install @rabiepenpm/eveniet-quas-porro

Usage

import { ProtoMini } from '@rabiepenpm/eveniet-quas-porro';

// Setup ProtoMini
const keyToValueMap = { foo: "f", bar: "b" };
const protoMini = new ProtoMini(keyToValueMap);

// Do magic encode/decode your json
const originalPacket = { foo: ["bar", { bar: "bar" }] };
const encodedPacket = protoMini.encodePacket(originalPacket); // {"f":["b",{"b":"b"}}}
const decodedPacket = protoMini.decodePacket(encodedPacket); // {"foo":["bar",{"bar":"bar"}]}

// Also it doing magic encode/decode your text
const originalText = "foo omg, yeah, bar bar, so-so";
const encodedPacket = protoMini.encodePacket(originalText); // "f omg, yeah, b b, so-so"
const decodedPacket = protoMini.decodePacket(encodedPacket); // "foo omg, yeah, bar bar, so-so"

API Reference

type KeyMapping = { [key: string]: string };
type Primitive = string | number | BigInt | boolean;
type Encodable = Primitive | Encodable[] | { [key: string]: Encodable };

constructor(keysMapping: KeyMapping)

Initialize a new ProtoMini instance.

encodePacket(packet: Encodable): string

Encode a packet.

decodePacket(encodedPacket: string): Encodable

Decode an encoded packet.

Tests

Run tests using Jest:

npm test

License

MIT

Author

šŸ‘¤ car1ot

Support

Raise an issue here for any bugs or feature requests.

css nestinguuidtouchRxECMAScript 7ES2017typedarrayparsingreactSymbol.toStringTagECMAScript 2023collectionisConcatSpreadableRFC-6455libphonenumberfind-uptrimEndUint8ClampedArrayoptimistconcurrencyRegExp#flagsprotomruurldeletearktypeESmake dirclassesloadingcachetelephoneasynceslint-plugincloudsearchbusymkdirsfastcloneregular expressionsmkdirspinnersyupregexpdescriptorform-validationreduxfindLastUint8ArraykoreandomfromdotenvpatchdeepcloneArraypopmotionURLworkspace:*electronMapgetterregexexpresswebredactflagtostringtagstateponyfill.envtrimRightvpccoredataViewcssflagsshammimepromisesestreeclassnameString.prototype.matchAll0apischemebrowserstylingaccessorlesses-shim APIcompile lesssnsuppackagees6Uint16ArraysigintjsHyBikeycloudfrontjsonwindowscolormetadataincludespredictabledirectoryObservableshas-ownimmutableweaksetinstallerhasOwnfetchwalkingES6react-hook-formPushSetweakmapfunctionastcheckreplaytypesafeformsbannerpathdom-testing-librarysliceauthenticationtyped arraynameslastspeedtrimStartcloudwatchelbhotglaciershellwaitcloneECMAScript 2020toSortedmacosgradients css3watchFilewarningextradefinejestfsgetsidecloudformationES8owngetPrototypeOfautoscalingstyleshardlinksenumerableparseInt16Arrayprefixnested cssec2stringifyPromisedropstatusuninstallpyyamlfullwidthvariables in csscallbackfixed-widthfastifycoerciblequotebreakeslintconfigstructuredClonereadablestreamTypedArraycjkwritablereact-hooksenvironmentbluebirda11ydragpipefunctionsairbnbfseventssetterkarmadynamodbchromiumcallboundawaitformattingconfigomitstreamcryptolesscsslinuxframeworkrm -frtddFloat64Arraysuperagentsymlinksigtermfast-deep-copybrowserlistopenbundlerlistenerssyntaxerroroperating-systemprotobufspinnermatchesES2020Iteratortypedarraysscheme-validationenderWebSocketsprocessbyteOffsetkinesisless compilerECMAScript 2019requireeast-asian-widthemojiexit-codetaskstatelessstyleindicatorES2023iterateio-tsargvtapeperformantless cssartisconcatMapcollection.es6idcommand-lineFloat32ArrayArrayBuffer.prototype.sliceviewhelperslook-uptoolscompilerprunefullslotarraysArray.prototype.flattenremoveArray.prototype.filterArrayBufferthroatreducerES5ObjectgesturesdebuglimitedjsxxhrserializextermcensorECMAScript 2016ECMAScript 2022yamlwafdescriptionauthbyteLengthratecss-in-jscss variablelogURLSearchParamsenvmapreduceasciimovegenericschannelargscircularUnderscorepackagesiterationeslintplugindebuggerjapanesesaferdserror-handlinginspectjasminechaifile systemtypescriptmobilefindcore-jshttpmaploggingbeanstalkrobustmixinsrgbjavascriptsesJSON-Schemacryptredux-toolkitECMAScript 5bootstrap lessspecObject.iscolourcompareECMAScript 2021dependencieszeroawsnpmfunctionalvalidebs[[Prototype]]rm -rfassertregular expressionlockfileformatsymlinksECMAScript 2018full-widthvalidateRegExp.prototype.flagschineseeslintArray.prototype.findLastIndexsimpledbthrottleavadependency managerboundWeakSetefficientlengthconcatReflect.getPrototypeOfmergepostcss-plugines2016matchAllES2022rfc4122CSSStyleDeclarationphonepreserve-symlinksYAMLemites2018utilitycall-bindsearchimportexportutilsomefast-copythreelanguageWebSocketES7testrmdircorssuperstructhashstyleguidezodJSONmoduleeventEmittergroupBy256readablecloudtrailgetintrinsicemreverylrureadrecursivereusefast-clonesharedarraybuffertraverseexpressionmiddlewarehigher-orderlazylinkless.jsstyled-componentswriteduplextextpnpm9ECMAScript 3es2015lintES2019lookES2018fastcopyinternalvariablessymbolidleoptimizerprivate dataReactiveExtensionsimmerinstallInt32ArrayguidObject.entriesnativestablenodeserializationes7sqsecmascriptmatchreact posewordwrapkeysReactiveXECMAScript 6autoprefixerinvariantarraybufferWeakMappositivetoobjectpostcssfileapollotestercharactersnumberdatastructuremulti-packageArray.prototype.flattypedcss lesshandlersgradients csss3queryhttpsflatMapoffsetstdlibes-abstractargparseimportUint32ArrayrapidagentwgetwrapgetOwnPropertyDescriptoriecurlclass-validatorECMAScript 2015shebangtoStringTagamazonqueueMicrotaskrandomreact animationfilterRxJS-0schemaprogressforEachdeep-clonecallbindreducecomputed-typeserrorconsumevisual$.extendstringclassnamesextensionjsdomTypeBoxArrayBuffer#sliceexitshimpersistentansittyl10narraytrimLeftdataviewcolumnfindLastIndexprettyextendargumentintrinsicpushpromisedirdeep-copyencryptioninterruptsstylesheetbcrypttypanionnodejseventsString.prototype.trimresolveroute53characterES2015groupstreamspropprototypebuffersES3joisyntaxfinduphookformMicrosoftwidthratelimitgraphqlclibddCSS
1.0.0

1 year ago