0

how to write this in es6?

./server.js

require('./config/passport')(passport);

and how the module itself should get 'passport'?

./config/passport.js

module.exports = function(passport) {}
Maor Ben
  • 309
  • 4
  • 13

1 Answers1

1

./server.js

import myFunc from 'config/passport';
myFunc(passport);

./config/passport.js

export default function (passport) {
    // Code
};

According to this at least: http://www.2ality.com/2014/09/es6-modules-final.html

Ben Guest
  • 1,488
  • 2
  • 17
  • 29