bami
bami

Reputation: 299

How to convert common js to ES6 modules?

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:

const m3o = require("m3o")(process.env.M3O_API_TOKEN);

Upvotes: 2

Views: 1137

Answers (1)

Lonnie Best
Lonnie Best

Reputation: 11364

I'm not familiar with m3o, but my ES6 translation of what you posted would be:

import { default as m3o } from 'm3o';
m3o(process.env.M3O_API_TOKEN);

Upvotes: 1

Related Questions