-
Notifications
You must be signed in to change notification settings - Fork 301
Convert to ES6 module #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Because Node.JS ESM support is still experimental and using import/export means adding a build step, which break the 0 dependencies principle 😉 |
Actually @Minigugus, if you look back before 1.0 release in the commits I had the source in import/export syntax, and then a small script to convert to commonjs, hehe.. The reason I removed it was because I didn't want to spend more time setting up dual packages (it didn't seem set in stone then), and I also liked being able to just instantly test stuff out.. I think the time is better now, so I'd be fine digging the conversion script back out, convert and also help us in the progress of making Postgres.js deno compatible 😉 |
Awesome 😄 Maybe this can help https://github.com/Minigugus/postgres-deno 😏 😉 Also, if you are ready for ES6 modules, what about full TypeScript conversion (still Deno compatible 😉)? |
Nodejs 14 is LTS NOW, supports import/export and dual package loading. So, it’s time to migrate :) |
Any updates? |
@maxpain There's a PR now, you're welcome to try out I still need to test this for all supported node versions using both cjs and esm before I can merge.. |
Hello friends I really wish this library supports CommonJS of importing packages using |
It does 😉 |
ow wow, therefore I can use
This is very nice, can you please add this as an example to the documentation? |
Sorry, I was just taking it as a given 😋 Make a PR with a comment in the very first code sample, I think that's good enoughOn 30 Jul 2024, at 14.46, Amanuel Elhanan ***@***.***> wrote:
It does 😉
ow wow, therefore I can use
const postgres = require('postgres')
const sql = postgres({ /* options */ }) // will use psql environment variables
export default SQL
This is very nice, can you please add this as an example to the documentation?
Thanks
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
why using module.exports whne you can import/export?
The text was updated successfully, but these errors were encountered: