Hacker News new | ask | show | jobs
by martinm3o 1522 days ago
At the time of writing the examples for the site we decided to use require as we had a lot of new Node.js developers and wanted to make sure they could just get going without having to know how to compile their code.

We will potentially move to import in the future, but people asked for require when the examples previously used imports.

With the package you can user import as an ES Module version is available:

> import M3O from 'm3o'; > const m3o = M3O(process.env.M3O_API_TOKEN);

Note: As long as the M3O_API_TOKEN environment variable is provided via a .env file then this is not required to be passed.