1.0.0 • Published 1 year ago

@f1stnpm3/ipsa-corrupti-reiciendis v1.0.0

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

About

Vikhola offers an event-driven framework for HTTP applications with high performance and scalability.

Why?

Events offer objects with a known API that will be sent to listeners who subscribe to them. Listeners, in turn, become independent services which, in addition to improving testability because of well-known API, are also easily replaceable. This helps to have confidence in the data during processes, which is especially important for a weakly and dynamically typed language as javascript.

Installation

$ npm i @f1stnpm3/ipsa-corrupti-reiciendis

Quick start

Package could be required as ES6 module

import { Server } from '@f1stnpm3/ipsa-corrupti-reiciendis';

Or as commonJS module.

const { Server } = require('@f1stnpm3/ipsa-corrupti-reiciendis');

First Server

The application starts by creating a server instance and adding the first route with a controller bound to it.

// Require the framework and instantiate it
const { Server } = require('@f1stnpm3/ipsa-corrupti-reiciendis');
const server = new Server();

// Declare a route
server.get('/', function (ctx) {
	ctx.response.send({ message: 'Hello World!' });
});

Route controller can be both sync and async.

server.get('/', async function (ctx) {
	// some async logic
	ctx.response.send({ message: 'Hello World!' });
});

After the route and its controller declaration first server is ready to go!

// Run the server!
server.listen(3000);

First Events

As mention before the @f1stnpm3/ipsa-corrupti-reiciendis framework provides its own events that will be emitted at different stages of request lifecycle. This example is uses "kernel.request" event, which will be executed before the controller, and "kernel.response", which will be executed after it.

// Declare a listeners
server
.on('kernel.request', function(event) {
    console.log('executes before controller.');
})
.on('kernel.response', function(event) {
    console.log('executes after controller.');
});

server.get('/', function (ctx) {
    console.log('controller.');
});

server.listen(3000);

Besides of server instance, listeners can listen for events on a specific route. This can be done by adding them to the route instance.

// Declare a global listeners 
server.on('kernel.request', function(event) {
    console.log('executes at every request.');
});

const route = server.get('/foo', function (ctx) {
    console.log('controller.');
});

// Declare a route scope listeners 
route.on('kernel.request', function(event) {
    console.log('executes only at this route request.');
}, { priority: 10 });

server.listen(3000);

At this example route scope listener executes before the global listener because of its priority. You can read about events, listeners and their options in the provided documentation.

Documentation

This is only a piece of functionality which provides @f1stnpm3/ipsa-corrupti-reiciendis framework to learn more you can follow documentation:

License

MIT

less.jsJSONutilitiesdeletedataViewcore-jstimeastfscorezerovalidES2018irqlimitpersistentgetoptfindupSeteverychecklruloggingcolumnsvarshasOwnstreamsshebangECMAScript 2022traverserdsUint8Arrayclonefseventsbundleristrimsymbolvpcstylesheettoolkites5variableslivecallbindrmbatchcomputed-typesbddrm -frRxJSspinnerlesscssglobalsformweakmapmonorepowgethookspredictableaccessortouchelasticacheexecutableperformantglacierECMAScript 2018windowsnodees8Object.fromEntriesInt8ArrayoptionphoneJSON-SchemapolyfillsameValueZeropatchURLtoStringTagiterationviewconcatvariables in cssframeworkstylessetImmediateloadbalancingsequencenamedescriptionmatcheslaunchspeedargumentsbootstrap lesssortedpnpm9inputtestermruPushrm -rfcircularrecursivegradients csstypedarraystaskeslintpluginnopecloudfrontlinkjQueryiteratorwritehandlersdataworkerrobustbluebirdeast-asian-widthjsxbrowserslistmoduleslicehashoptimistoptimizertestObservablesamazonprefixgetOwnPropertyDescriptorsymbolsbrowseremojirestsuperagentECMAScript 6ECMAScript 7watchqsspawnmkdirjoiaccessibilityworkflowtsdefaultrangeerrorString.prototype.matchAllclassesregular expressionfull-widthgroupStreamssettingstapereadableECMAScript 2017RegExp#flagsfunctionsless cssfindLastIndexArrayBuffer.prototype.slicehotsymlinksauthlintjsdomfluxESnextworkspace:*reactbcrypthttpsstartrequireyamlstyled-componentsscheme-validationvalidationtostringtagjestdeep-clonedataviewObject.definePropertychildstyleguideclassnamesdatastructureIterator$.extendpropertygenericsdomsetPrototypeOftypesurlcssmixinsincludesi18nhasxhrObject.assignenvironmentlastdefinethroatvisualruntimeargumenttakeMapcss-in-jstrimRightes7authenticationeventspackage.jsoncompilerReflect.getPrototypeOfprettyjapaneseObject.entrieserror-handlingqueueMicrotaskcryptofullwidthsortoutputless compilerargparsewalkdescriptorlesscallboundparseregular expressionsserializertoSortedWebSocketsextendArrayremovequerychaijavascript-0react-hookstypeddiffappeventDispatcherfastcopyduplexECMAScript 2020sometermmacosspinnersdayjsprotocol-buffersflaggetPrototypeOfjschineseArrayBuffer#slicetoolsRFC-6455fromasciistdlibbyteLengthdependency managerlimitedxtermcjkpathdotenvredactwatcherfigletchromiumprototypeenderbyteOffsetformshas-ownInt16Arrayutil.inspectcreate.envdebuggerentriesutilartes-abstractsymlinkwatchingcss variableansishellpositiveelectronargsmkdirsstreams2rgbstylesharedshamreadablestreamwebtrimEndstringlistenersparentfindLasttddtypefolderefficientstateArray.prototype.flatMaptelephonekinesisfind-upidlewafstarterES2022Object.keystrimStartvaluesapiecmascriptoperating-systemelmlinewrapes2016intrinsicsharedarraybufferclassnamemimetypeslazyshimRxweaksetarrayterminalimmutablefile systemopensstructuredClonetypeerrorstringifierttygdprcompile lesscmdpropertiestypesafenpmtypescriptnegative zeroopenspecsimpledbjshintObservable0commandercryptpropmapreducetapeslintconfigswfObject.valuesconcurrencyfastcloneroute53jsonpathmake dir_.extendsafeES5Uint32ArrayassertssetieES2021mergeajaxpluginrmdirschemapostcsstextcontainsstylingparsingES2015uuidxdg-openbufferstringifyArray.prototype.flattenxdgcss lessredux-toolkititeratehardlinksfilevestnegativeregexrapidInt32Arrayautoscalingcloudformationescapepromisees2017deepcloneequaltslibnested cssSymbol.toStringTagimport__proto__getterupuninstallsinatradeepdeep-copyrouterstatelessisConcatSpreadablekoreanES2019fastarraysregexpes2015sidefiltermakecacheclass-validatorresolveTypedArraymatchdebugSymbolprivatecoloriamReactiveXpushECMAScript 3namesdynamodbcommandownbootstrap cssTypeScriptrfc4122openerlook-upexit-codeformatHyBireplayes-shimsReactiveExtensionsUint8ClampedArrayhttpESinterruptssesponyfillschemebeanstalkPromisesettera11ypackagequerystringsnswebsitecodesmime-dbcommand-linemobileforEachMicrosoftAsyncIteratormapinspectdefinePropertyCSSStyleDeclarationreact-hook-formchrome@@toStringTagwaitES2016numberrequestfunctionECMAScript 5directoryBigUint64Arrayfast-copygradients css3[[Prototype]]es2018RegExp.prototype.flagsratelimittc39WeakMapbufferscorsinstallerec2espasswordECMAScript 2015searchyupbannerUint16Arrayassertcollection.es6ES8channelflagsutilityinternal slotregularflatconfigES2017jwtautoprefixerairbnbloggersyntaxerrornodejsencryptionECMAScript 2016jsdiffobjconsoleeditorsigintassignexeawaitObject.getPrototypeOfkeysvaluepreserve-symlinksmimeexecsuperstructwarningtoobjectavaboundclifast-clonereusewidthprocessES7inferencecolorsfullunicodepostcss-pluginjsonlogformattingindicatorcloudtrailstableinternalestreeES2020shrinkwrapcolourdeterministicfunctionalES6io-tsconsumebusyprogressstatusargvreact-testing-libraryhelpersimmergetthrottlecall-bindextensionmulti-packageproxyminimalerrorrandoml10nratequeueTypeBoxkeyurlseventEmitterfastifyBigInt64Arraywordwrapcloudsearchajvcomparequoteeslint-pluginenvStyleSheetcolumnlockfileperformancereduxECMAScript 2019awscode pointsebsreducerdescriptorswritablefixed-widthdateoffsetvalidatesignalsparsers3callES2023sqsWebSocketreal-timemiddlewarefast-deep-clonepicomatchgroupByelbWeakSetfindexpressArray.prototype.flatcharacterdom-testing-libraryECMAScript 2021arraybuffersignalpackage managerbrowserlistpyyamlawesomesauceeslinttestingtoArrayArray.prototype.filtercopyobjectreadtypedarraywordbreakmochapipeguidserializationlanguagedependencieslooktrimLeftmatchAllpreprocessorparentslibphonenumberless mixinsprotobufArray.prototype.includesfetchglobalwrapFloat64ArraymodulessigtermprunekarmaES3metadataflatMapomitObject.isequalityjasmineemrmomentcloudwatchcallbackexpressionhigher-ordercharactersform-validationhasOwnPropertyreducenativeimportexportes-shim APIprivate datacoerciblepromisesmoveinstallconnectmkdirpes6URLSearchParamsincensorsyntaxdropUnderscoreextraconfigurablewatchFilearktypefpsbindbreaktypeofoncewalkingCSSexitArray.prototype.containshookformlength256collectiontypanionserializeasyncidloadingidentifierscss nestingFloat32ArrayFunction.prototype.nameendpointstoragegatewayglobArrayBufferzodemitflattenYAMLinvariantString.prototype.trimStreamcall-boundrestfulenvironmentsObjectstreamtyped array
1.0.0

1 year ago