Lets say I have a JavaScript file(lib.js) which exports some classes, functions, etc etc.
export class Employment {
id = "";
startDate = "";
endDate = "";
companyEmailAddress = "";
};
export function HolidayPopupContainer() {
return (<div id="#HolidayPopupContainer" />);
}
export default withStyles(styles)(Button);
export default class DayView extends React.Component {
constructor(props) {
super(props);
this.state = {
readOnly: false
}
};
export const Status = [
"Select Status",
"Pending",
"Approved",
"Rejected",
"All"
]
Now this file is saved as lib.js in one of the folder. As this file has exports, those exported can be imported by other JavaScript files.
Is there a way where we can programmatically find the full list of exports from a JavaScript file.
The expected output should be a list/array/json etc. The output for the above mentioned js file would be
Employment
HolidayPopupContainer
withStyles
DayView
Status
Can Object.keys be of any help here?