Add query-stream and cursor as esm exports

This commit is contained in:
Brian Carlson 2025-04-21 13:57:24 -05:00
parent 0a0e298e06
commit ffd5adc583
7 changed files with 23 additions and 3 deletions

View File

@ -5,7 +5,7 @@
"main": "index.js",
"exports": {
".": {
"import": "./esm/index.js",
"import": "./esm/index.mjs",
"require": "./index.js",
"default": "./index.js"
}

View File

@ -17,7 +17,9 @@
"pg": "^8.14.1",
"pg-pool": "^3.8.0",
"pg-native": "^3.3.0",
"pg-cloudflare": "^1.1.1"
"pg-cloudflare": "^1.1.1",
"pg-cursor": "^2.13.1",
"pg-query-stream": "^4.8.1"
},
"author": "Brian M. Carlson <brian.m.carlson@gmail.com>",
"license": "MIT"

View File

@ -0,0 +1,9 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import Cursor from 'pg-cursor'
describe('pg-cursor', () => {
it('should export Cursor constructor as default', () => {
assert.ok(new Cursor())
})
})

View File

@ -0,0 +1,9 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import QueryStream from 'pg-query-stream'
describe('pg-query-stream', () => {
it('should export QueryStream constructor as default', () => {
assert.ok(new QueryStream())
})
})

View File

@ -6,7 +6,7 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"import": "./esm/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
}