
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
currentrequest
Advanced tools
Request handling engine for handling server or small task. for more visit : readme.md
CurrentRequest is engine which can execute any given batch of method's or function's which you want to execute small or big task based on your need. with some inbuilt functionality which are pretty much help full for developing application's in javascript.
Use case's :
Below are considiration what CurrentRequest is about:
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Documentation : comming soon
1. Enviornment Variable's.
Details: CurrentRequest need some environment variable which will going to be needed for handling project. below are all environment variable's on which currentRequest depend's on. you can change them if your project folder location's are different.
NAME ='CurrentRequest' // projectname : used as Database name and Server name
DMDir = 'dyna_modules' // directory: directory name containg your method's.
MLDir = 'ml_modules' // directory: machine learning directory name module's directory.
GUIDir = 'GUI' // directory : directory name containg view in following languages [pug, ejs]
ENVIRONMENT=development // debug: used when debuging error and return's by method.
CR_RETURN_TYPE=configuration // output : current request process your request and can return output [single object] or internal configuration containg every information form who runned and when.
AWS_SECRET_ACCESS_KEY="Your AWS sceret accesskey" // AWS : used when connect's with AWS account.
AWS_ACCESS_KEY="access_key" // AWS : used when connect's with AWS account.
SENTRY_DSN="dsn_key" // ERROR : useful for handling any error occured internally in queue.
2. Database Driver
Details: Each batch of task output return's [array] containg output of each method.now you can store these output to database for that just run your database server currentRequest currentlly support's mongoDB[stable] and mySql[comming soon] or if you want to see just output no database run than just pass _noDatabase key in configuration.
Note 1: Query will be auto generated so in database you will going to see structure to your every collection > document
Note 2: By default mongoDB is used is database option for other database's pass { _connectTo : "databaseName" } in configuration.
Structure :
_RAW: {
_method1 : "methodOutput",
_method2 : "methodOutput",
_method3 : "methodOutput"
}
CurrentRequest can installed with following flavour's.
Npm :
npm i currentrequest --save
Yarn :
yarn add currentrequest
Clone :
git clone https://gitlab.com/rootandleaves/currentrequest.git
CurrentRequest require's configuration in-order to run. each configuration key relates to special work in engine.
Please note : This is not complete list of configuration for that please read doc's
CurrentRequest has special method named xHeader which allow's currentrequest to validate user's or client's based on interaction. these is done as follow's :
Step's
Why xHeader.
Below is simple example of account registration api in less than 1 min.
MongoDB Server :
sudo mongod --master
Redis Server :
redis-server /usr/local/etc/redis.conf; sudo redis-server /usr/local/etc/redis.conf
Code Setup :
import CurrentRequest from 'currentRequest' // npm: modern code handler tool.
import Joi from 'joi' // npm: object validation libary.
/*
GLOBAL'S.
*/
let _ProceedLogin, _loginConfiguration
// ServerAccountRegistrationRequest is conceptual method describing
that this request handler for any given route let say /accountRegister.
ServerAccountRegistrationRequest(request, reply) => {
// variable assignment
_loginConfiguration = {
name: 'SomeFancyRegistration'
whichDoc: 'Users',
hooks: {
'_onLoad': {
'registration': await (Context) => {
// [Context](http://currentrequest.com/docs#Context) api as lot other feature's
// out of them one is Configuration it allow's you
// to load data or execution update's..here we are
// loading our payload passed in configuration.
// using configuration you can get any key written
// in configuration you are passing.
let { _POST } = await Context.Configuration.get()
...after your code...
// return data to queue.if you want
// to pause queue so that it don't execute
// further than return queue with CR_Paused
// options set to true. also not that
// every method should return _RAW_SCHEMA
// as this acts as return schema for this
// method which is used while writing output's
// to database.
if(...JustStopExecution...) {
// return _POST.
return {
..._POST,
'options': {
'_RAW_SCHEMA': Joi.object(),
'CR_Paused': true
}
}
} else {
// return _POST.
return {
..._POST,
'options': {
'_RAW_SCHEMA': Joi.object()
}
}
}
}
}
},
'FileManager_Config': {
'whereToStore': 'local', // change to S3 and update your AWS credential's in enviornment it will start putting all update's to s3 bucket.
'path': './userAccountPhotoDirectory' // auto create directory and store any file uploaded to this route.
},
'_POST': __request.payload, // request payload..
'_POST_SCHEMA': { // Joi schema for validating payload's..only allow those whose name is present in _POST_SCHEMA else are removed..
'email': Joi.string().email(),
'username': Joi.string(),
'password': Joi.string(),
'profilePicture': Joi.object()
},
'returnFormat': 'data', // return only method's output stored in _RAW key..if you wan't to return configuration which you are reciving inside hook's than
just change 'data' => 'configuration'
'task': 'CREATE' // this task define's which crud operation will going to happen.
}
// Before execution please update request with "y" header
// you can do this on client side and then send request
// or you can just create and manage key here by itself
// just by passing "y": "unqieue string"
if(...ClientSideHeaderCreated...) {
// run as normal request.
_ProceedLogin = await new CurrentRequest({ request, 'options': _loginConfiguration })
} else {
// create new "y" key.
request.headers['y'] = 'somefancyYKey'
// continue normal execution.
_ProceedLogin = await new CurrentRequest({ request, 'options': _loginConfiguration })
}
// if _ProceedLogin contain's error than report failure.
// else return Output.
if(!_.propertyOf(_ProceedLogin)) {
// local variable.
let _replyOutput
...do something with output...
_replyOutput = ...did something with _ProceedLogin.Output...
// return data.
return _replyOutput
} else {
// report failure.
return _ProceedLogin.error
}
}
We use Semanticversioning for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
Request handling engine for handling server or small task. for more visit : readme.md
We found that currentrequest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.