I know that there are many solutions to convert es6 to js. but when I was searching, I didn’t find any solution converting js to es6! in my case I really need to convert this code to es6:
JavaScript
x
2
1
const m3o = require("m3o")(process.env.M3O_API_TOKEN);
2
Advertisement
Answer
I’m not familiar with m3o, but my ES6 translation of what you posted would be:
JavaScript
1
3
1
import { default as m3o } from 'm3o';
2
m3o(process.env.M3O_API_TOKEN);
3