As commented, you will have to create a map and using that you can call the functions.
You can try one of following approach:
Single export
Benefit of this approach is that you have a single export, so you know what all you are exporting. However, you will have to scroll up and down to see definition, if the file grows big. Plus, you are bleeding everything, so out(...)
can call any function, so no point in exporting them individually
function today() {}
function yesterday() {}
function tomorrow() {}
function out(input) {
module[input]();
}
var module = {
today, yesterday, tomorrow, out
}
export module;
Map of possible function
This is more recommendable approach. Here you have a map of possible actions. So, you are restricting possible inputs as well. This will also enable you to have more meaningful names for both action and function. Disadvantage would be to have to maintain a list. So for every new action, you will have to update this list
export function today() {}
export function yesterday() {}
export function tomorrow() {}
const actionMap = {
TODAY: today,
YESTERDAY: yesterday,
TOMORROW: tomorrow
}
export function out(input) {
actionMap[input]();
}