I am confused while encountering this over-looked question like how they are different ?

```js
Module.exports = {
  search_companies(req, res) {
    //some ops
  },

  get_details(req, res) {
    //some ops
  }
};
```

vs

```js
class MainContrller {

  search_companies(req, res) {
      //some ops
    },

    get_details(req, res) {
      //some ops
    }
}

module.exports.MainController = MainController;
```