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) {}
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) {}
./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