Change the module from CommonJS to ECMAScript Module (ESM). Some JS Frameworks support ESM now and importing CommonJS modules may get complicated. Given that Node.js 12 has become a MAINTENANCE LTS, ECMAScript modules are the official standard format to package JavaScript code for reuse. Converting to ESM is recommended because ESM can still import CommonJS packages, but CommonJS packages cannot import ESM packages synchronously.
Two possible solutions are:
Completely move to JavaScript ES Modules.
Introduce a build step that transpiles a CommonJS fallback.
Change the module from CommonJS to ECMAScript Module (ESM). Some JS Frameworks support ESM now and importing CommonJS modules may get complicated. Given that Node.js 12 has become a MAINTENANCE LTS, ECMAScript modules are the official standard format to package JavaScript code for reuse. Converting to ESM is recommended because ESM can still import CommonJS packages, but CommonJS packages cannot import ESM packages synchronously.
Two possible solutions are:
I can send in a PR if you agree.