Home | Full API | Tutorial | Project Setup Guide (CJS / MJS)
This is an early draft of this guide. More coming soon.
This guide looks a bit different depending on whether you are using Common JS Modules (CJS, using the require
statement and module.exports
) or ES Modules (MJS, using the import
and export
statements). We will refrain from commenting on the State Of Javascript™ except to say that this discrepancy sucks and there is no easy solution to make the two patterns work together seemlessly.
Our workaround for the moment is to let you choose your own adventure:
I will choose CJS (with require and module.exports).
I will choose MJS (with import and export).