Frequently asked question these days is how to use module.exports
in ES6 style.
The export declaration is used to export values from a JavaScript module.
module.exports = Car
in ES6:
export default Car
module.exports.Car = Car
ES6 equivalent:
export { Car }
Then you can import it as usual:
import defaultImport from 'module'
Or:
import { someVar } from 'module'