Repository: brianc/node-postgres (language: javascript)

Issue:
pg-connection-string v2.8.0 broke default export
> @hjr3 just a heads up, 2.8.0 was technically a breaking change. Even though `module.exports = parse` still existed, it broke the default export:
> 
> ```
> import pgConnectionString from 'pg-connection-string';
>        ^^^^^^^^^^^^^^^^^^
> SyntaxError: The requested module 'pg-connection-string' does not provide an export named 'default'
>     at ModuleJob._instantiate (node:internal/modules/esm/module_job:180:21)
>     at async ModuleJob.run (node:internal/modules/esm/module_job:263:5)
>     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
>     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
> 
> Node.js v22.14.0
> ```
> 
> I'm guessing it's an ESM / bundler or whatever type error, but it's easy enough to fix and switch to `import { parse } from 'pg-connection-string';` 

 _Originally posted by @ThisIsMissEm in [#3421](https://github.com/brianc/node-postgres/issues/3421#issuecomment-2822279994)_


Discussion / hints:

Fix patch:
diff --git a/packages/pg-connection-string/esm/index.mjs b/packages/pg-connection-string/esm/index.mjs
index eb2d0c0f9..7b390c514 100644
--- a/packages/pg-connection-string/esm/index.mjs
+++ b/packages/pg-connection-string/esm/index.mjs
@@ -2,6 +2,7 @@
 import connectionString from '../index.js'
 
 // Re-export the parse function
+export default connectionString.parse
 export const parse = connectionString.parse
 export const toClientConfig = connectionString.toClientConfig
 export const parseIntoClientConfig = connectionString.parseIntoClientConfig


Test patch: