suvanl / delet3

delet³ - Discord bot. Currently in alpha.
http://delet3.web.app
MIT License
6 stars 0 forks source link

Switch to ES Modules #56

Closed suvanl closed 2 years ago

suvanl commented 2 years ago

Currently, delet3 uses the CommonJS (CJS) module system, recognisable through the use of require() and module.exports, exports.constName = someConst, etc. The more modern approach is to use ES modules (ESM), which can be recognised through the use of the import and export keywords.

This PR updates all CJS module imports/exports with the ESM syntax, and makes adjustments where appropriate, as there are functional differences between CJS and ESM.

To support directory imports using ESM, the --experimental-specifier-resolution=node flag must now be included when starting delet3.