I'm wanting to programmatically generate the exports for a module, is this possible in es6?
Something along these lines:
const ids = ['foo', 'bar', 'baz'];
ids.forEach(id => {
export const [id.toUpperCase()] = id;
});
See Question&Answers more detail:os