for data that only needs to be available during an individual request, where should it be stored?
i am creating new properties on the req and res objects so i dont have to pass that data from function to function.
req.myNewValue = 'just for this request'
is the process object an option? or is it shared globally across all requests?
If you are talking about the variable passed like here:
then it is perfectly fine what you are doing.
reqstores the request data, you can modify it as you want. If you are using some framework like Express, then it should be fine as well (keep in mind that you may overwrite some built-in properties ofreqobject).If by “process object” you are refering to the global variable
process, then absolutely not. The data here is global and shouldn’t be modified at all.