Open cjnoname opened 7 months ago
thank you for submitting this enhancement idea - team will consider it for later, as it is not in the plans for the near future.
thank you for submitting this enhancement idea - team will consider it for later, as it is not in the plans for the near future.
Thanks dude!
Would you accept a PR for this?
as it is not in plans for the foreseeable future, if you however have the resources then it's indeed very much appreciated !
Since most modern JS/TS codebases leverage ES Modules, could you at least provide documentation on how to update build config using commonjs/polyfill to be compatible?
EDIT: For those of you struggling to get this lib building and running in an ES Module based project. I'd recommend checking out Sequelize with their Snowflake experimental support. It uses this lib under the hood but provides good quality of life features on top of it such as using ESModule out of the box, it enables the use of async/await so you don't have to manage promise wrapping yourself (longest running feature request since 2018 on this lib) + you get the added benefit of adding types to your query results which is useful in Typescript based projects.
Adding this shim to my esbuild options allows it work with ES Modules, but it's painful.
"banner": {
"js": "import { createRequire } from 'module'; const require = createRequire(import.meta.url); import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); import path from 'path'; const __dirname = path.dirname(__filename);"
}
What is the current behavior?
This package does not support ESM (ESModule)
What is the desired behavior?
This package should suport both CommonJS and ESModule
How would this improve
snowflake-connector-nodejs
?More and more new projects are adopting ESM