mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
366 stars 91 forks source link

Support for ESM #210

Closed H14 closed 1 year ago

H14 commented 1 year ago

Hello

I was wondering how to use this library in a project based on ECMAScript modules. I can only find examples based on CommonJS in the documentation.

Are there any plans to add ESM support in the future?

Can I, in the time being, safely wrap the require() statements, and how do I do it safely?

Thanks!

H14 commented 1 year ago

This works fine :-)

 import mariadb from 'mariadb';