{"_id":"@neon/functions","_rev":"8-32d3c52a22cf39548c22e990ca2ff1c5","name":"@neon/functions","dist-tags":{"latest":"0.11.0"},"versions":{"0.0.0":{"name":"@neon/functions","version":"0.0.0","keywords":["neon","functions","database","postgres"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.0.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"9f7e253cd2506bcf3e38b0438394fda5f6892331","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.0.0.tgz","fileCount":1,"integrity":"sha512-ociv+xJma5V3NpPYQoYlWg3Wx+ok8U1YdjENHjjeG1qTTF9qVdHGNAdmgTt9Gy+ALq6+SER5aLZlmW9wwzwXjA==","signatures":[{"sig":"MEUCICU6hP5SgDO+A43xkBpfzlaUbE14l1rSWfee/u5xEgufAiEArlgLOOo+dkirzd5IzxfILNY8ytBsH/uvfFBiadqCnZg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":633},"_npmUser":{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},"repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git","directory":"packages/functions"},"_npmVersion":"10.2.3","description":"Neon functions utilities.","directories":{},"_nodeVersion":"20.10.0","publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/functions_0.0.0_1782408838703_0.4334961634529235","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@neon/functions","version":"0.5.0","keywords":["neon","database","postgres","functions","serverless","platform"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.5.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"22df558bd6b3dcd760ff57dfc129ab83f61b5e52","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.5.0.tgz","fileCount":9,"integrity":"sha512-oNA6Q0TP24Zt2vkm23kkIHEGPhRLok94jPDwi2wKb+Rsn2TcaI+BwPTuFfSRxqBawNQbvszZi34XLQjA4jAhJQ==","signatures":[{"sig":"MEYCIQCWhDhQl9PdWWP/7bOf0e0gEkAtKNqRoXrGyzKsxzgt8AIhAPPVoPuw1AkQvduH1KHo3ScWUsrSUwmtqdPeX9FFjoZz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16445},"main":"dist/index.js","type":"module","_from":"file:dist/neon-functions-0.5.0.tgz","types":"dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.5.0.tgz","_integrity":"sha512-oNA6Q0TP24Zt2vkm23kkIHEGPhRLok94jPDwi2wKb+Rsn2TcaI+BwPTuFfSRxqBawNQbvszZi34XLQjA4jAhJQ==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions. Currently provides a `waitUntil` primitive for deferring async work past a response.","directories":{},"_nodeVersion":"22.23.0","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"3.0.9"},"_npmOperationalInternal":{"tmp":"tmp/functions_0.5.0_1782834710807_0.13871155227600784","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@neon/functions","version":"0.6.0","keywords":["neon","database","postgres","functions","serverless","platform"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.6.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"a68bf4479fd690a219875e3a7c4d1406f2697db7","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.6.0.tgz","fileCount":9,"integrity":"sha512-5LWQNSnIeBqId2rcdQUPTpuNShYAaoAVlf6ElhsCMyLO5f5AYCdvjjWWOrZDx0Rqp6JE9p/JTdfEIBbK0JLB9g==","signatures":[{"sig":"MEUCIQCilZ/GSsrnPPIRriYmeZ4rtV3QjQBtLI9QkDTUroC5bQIgbSOCBnnbkqutCf8F97r0TbKfgQz5BGbAYfuD2e3nwrA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16489},"main":"dist/index.js","type":"module","_from":"file:dist/neon-functions-0.6.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.6.0.tgz","_integrity":"sha512-5LWQNSnIeBqId2rcdQUPTpuNShYAaoAVlf6ElhsCMyLO5f5AYCdvjjWWOrZDx0Rqp6JE9p/JTdfEIBbK0JLB9g==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions. Currently provides a `waitUntil` primitive for deferring async work past a response.","directories":{},"_nodeVersion":"22.23.0","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"3.0.9"},"_npmOperationalInternal":{"tmp":"tmp/functions_0.6.0_1783010468159_0.5089157224441248","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@neon/functions","version":"0.7.0","keywords":["neon","database","postgres","functions","serverless","platform","websocket"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.7.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"26ef9278a9b2a411a76cfab7d5a41e51ace9ae8c","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.7.0.tgz","fileCount":13,"integrity":"sha512-5IPzPxJd99T9mIF3jHW6VAsGGooonLmDnJ4DnC2VXTZdt8IKp8v38ss6GP0CsmXQC1FpGhdj+P49wM041VdjfA==","signatures":[{"sig":"MEUCIQCjXmxtxV5K8UziWFDcbijA7FIhKQJkJ7XdBBTsod8+QgIgVcrwvOjO0EkpV5pdWaXDXvp47fPepH/kbXNZT2GNPPc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30461},"main":"dist/index.js","type":"module","_from":"file:dist/neon-functions-0.7.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.7.0.tgz","_integrity":"sha512-5IPzPxJd99T9mIF3jHW6VAsGGooonLmDnJ4DnC2VXTZdt8IKp8v38ss6GP0CsmXQC1FpGhdj+P49wM041VdjfA==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, and `upgradeWebSocket` for serving WebSockets from a fetch handler.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.9.0","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"^3.0.9"},"_npmOperationalInternal":{"tmp":"tmp/functions_0.7.0_1786009608567_0.46629242501147417","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@neon/functions","version":"0.8.0","keywords":["neon","database","postgres","functions","serverless","platform","websocket"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.8.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"dcf1873f02c4a73f822c6a03942a73986b785513","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.8.0.tgz","fileCount":17,"integrity":"sha512-571d10BHXi2aEgxDaKIVL7NnEb25Dx7aduMyfu2xdo1BPTaVEJ4vKs3JUOGpqx1gMzhX5gioRK0dN8tjuRkdUQ==","signatures":[{"sig":"MEQCIBO4kejr3LtlCaDqlfoA5IBhAE6BQ/uYt+Tl/IMwVAqnAiAYeVwzbapOh0CMA41G58v2xgIGmwljhLQ1+RiLqtjpEw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42315},"main":"dist/index.js","type":"module","_from":"file:dist/neon-functions-0.8.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.8.0.tgz","_integrity":"sha512-571d10BHXi2aEgxDaKIVL7NnEb25Dx7aduMyfu2xdo1BPTaVEJ4vKs3JUOGpqx1gMzhX5gioRK0dN8tjuRkdUQ==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, `upgradeWebSocket` for serving WebSockets from a fetch handler, and `attachDatabasePool` for node-postgres idle-client errors.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.9.0","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"^3.0.9"},"_npmOperationalInternal":{"tmp":"tmp/functions_0.8.0_1786997906915_0.4299828302894235","host":"s3://npm-registry-packages-npm-production"}},"0.9.0":{"name":"@neon/functions","version":"0.9.0","keywords":["neon","database","postgres","functions","serverless","platform","websocket"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.9.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"ac722be16a1d81d6546045509d5872dc074aa24b","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.9.0.tgz","fileCount":24,"integrity":"sha512-+LRbjm7qOStQ32T8MJ8jndQz4g2q9FYsqvBcsByK/5SGgw5gB661PLtJBu2ABYav3TlkOAV9ygLH9jvpKrx+Rw==","signatures":[{"sig":"MEUCIQCLKWvxv4+rkqpVw1T7MJUDpNv2UHIgRPQSyaHjoXOmhAIgVZ/9IWt45vV4bIoaP6lXVRCDemxUZPgkl2F8kai581Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58689},"main":"dist/index.js","type":"module","_from":"file:/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.9.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./hono":{"types":"./dist/hono.d.ts","import":"./dist/hono.js","default":"./dist/hono.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.9.0.tgz","_integrity":"sha512-+LRbjm7qOStQ32T8MJ8jndQz4g2q9FYsqvBcsByK/5SGgw5gB661PLtJBu2ABYav3TlkOAV9ygLH9jvpKrx+Rw==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, `upgradeWebSocket` for serving WebSockets from a fetch handler or a Hono route, and `attachDatabasePool` for node-postgres idle-client errors.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.12.25","tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.9.0","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"^3.0.9"},"peerDependencies":{"hono":"^4.7.8"},"peerDependenciesMeta":{"hono":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/functions_0.9.0_1788309189572_0.31683666229275786","host":"s3://npm-registry-packages-npm-production"}},"0.10.0":{"name":"@neon/functions","version":"0.10.0","keywords":["neon","database","postgres","functions","serverless","platform","websocket","triggers"],"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","_id":"@neon/functions@0.10.0","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"homepage":"https://github.com/neondatabase/neon-pkgs#readme","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"1c784075ca654cc58811eedba072eedc71325599","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.10.0.tgz","fileCount":34,"integrity":"sha512-ru86P1ZThXjZRJ1OSUvYxAk7+lZC284RXfFXdFAsdvU4Bk/SqzcFbTw7OLFSOWEb9GfTczdzsxGBtAVra/MDOw==","signatures":[{"sig":"MEUCIQD8vkIGKjsndEDEgxAPPtc0v1X5bGq93bCgNv+lei+r3gIgN2ZEvLunbX62yKj3sPMOPSdCU/Vk11654fqekHDe4fw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74081},"main":"dist/index.js","type":"module","_from":"file:/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.10.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./hono":{"types":"./dist/hono.d.ts","import":"./dist/hono.js","default":"./dist/hono.js"},"./triggers":{"types":"./dist/triggers.d.ts","import":"./dist/triggers.js","default":"./dist/triggers.js"}},"scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.10.0.tgz","_integrity":"sha512-ru86P1ZThXjZRJ1OSUvYxAk7+lZC284RXfFXdFAsdvU4Bk/SqzcFbTw7OLFSOWEb9GfTczdzsxGBtAVra/MDOw==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, `upgradeWebSocket` for serving WebSockets from a fetch handler or a Hono route, `attachDatabasePool` for node-postgres idle-client errors, and `parseTriggerInvocatio","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.12.25","tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.9.0","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"^3.0.9"},"peerDependencies":{"hono":"^4.7.8"},"peerDependenciesMeta":{"hono":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/functions_0.10.0_1789154117203_0.2954780317088952","host":"s3://npm-registry-packages-npm-production"}},"0.11.0":{"_id":"@neon/functions@0.11.0","bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"dist":{"shasum":"c993723bc5767edb83e435bf06c9f13a21a4295e","tarball":"https://registry.npmjs.org/@neon/functions/-/functions-0.11.0.tgz","fileCount":34,"integrity":"sha512-xyIEk9aULR2nBTzyTgxljkM8aS+Ppe9oVw/t5mdqYOlY/mLFppHSZHq8hiWVDWy6Ca8oLd3loTtfVz+cZQQjsA==","signatures":[{"sig":"MEUCIGO/JFnqQfNYQQkynwj+cbV+NCJ4ULxpLphI5LuaBDi3AiEAxvBJeoEwgw2qEXQMeNafzKrGd5Tr62ekarbdrNpu3Vc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFa/Dh6iHAh9T0Gg6DVIGytpTVn5VIlToM0xg8eiIGQCAiBu8GOkGHCqVbHXmxso10MVqYMHT1msoKj8Q/5YspEbQA=="}],"unpackedSize":85690},"main":"dist/index.js","name":"@neon/functions","type":"module","_from":"file:/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.11.0.tgz","types":"dist/index.d.ts","author":{"url":"https://neon.com","name":"Neon"},"engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./hono":{"types":"./dist/hono.d.ts","import":"./dist/hono.js","default":"./dist/hono.js"},"./triggers":{"types":"./dist/triggers.d.ts","import":"./dist/triggers.js","default":"./dist/triggers.js"}},"license":"Apache-2.0","scripts":{"tsc":"tsc","test":"vitest --passWithNoTests","build":"tsc --noEmit && tsdown","test:ci":"vitest run --passWithNoTests"},"version":"0.11.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fed2de47-8939-4af5-8b05-b8afbc6c8e5e"}},"homepage":"https://github.com/neondatabase/neon-pkgs#readme","keywords":["neon","database","postgres","functions","serverless","platform","websocket","triggers"],"_resolved":"/home/runner/work/secure-public-registry-releases-eng/secure-public-registry-releases-eng/dist/neon-functions-0.11.0.tgz","_integrity":"sha512-xyIEk9aULR2nBTzyTgxljkM8aS+Ppe9oVw/t5mdqYOlY/mLFppHSZHq8hiWVDWy6Ca8oLd3loTtfVz+cZQQjsA==","repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"_npmVersion":"10.9.8","description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, `upgradeWebSocket` for serving WebSockets from a fetch handler or a Hono route, `attachDatabasePool` for node-postgres idle-client errors, and `parseTriggerDelivery`","directories":{},"maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"_nodeVersion":"22.23.2","publishConfig":{"provenance":false},"_hasShrinkwrap":false,"devDependencies":{"hono":"^4.12.25","tsdown":"^0.14.1","vitest":"^3.0.9","typescript":"^5.9.0","@types/node":"^20.19.0","console-fail-test":"0.5.0","@vitest/coverage-v8":"^3.0.9"},"peerDependencies":{"hono":"^4.7.8"},"peerDependenciesMeta":{"hono":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/functions_0.11.0_1789584126608_0.21710935175013457"}}},"time":{"created":"2026-06-25T17:33:58.578Z","modified":"2026-09-16T18:42:06.895Z","0.0.0":"2026-06-25T17:33:58.831Z","0.5.0":"2026-06-30T15:51:51.031Z","0.6.0":"2026-07-02T16:41:08.299Z","0.7.0":"2026-08-06T09:46:48.689Z","0.8.0":"2026-08-17T20:18:27.073Z","0.9.0":"2026-09-02T00:33:09.706Z","0.10.0":"2026-09-11T19:15:17.342Z","0.11.0":"2026-09-16T18:42:06.694Z"},"bugs":{"url":"https://github.com/neondatabase/neon-pkgs/issues"},"author":{"url":"https://neon.com","name":"Neon"},"license":"Apache-2.0","homepage":"https://github.com/neondatabase/neon-pkgs#readme","keywords":["neon","database","postgres","functions","serverless","platform","websocket","triggers"],"repository":{"url":"git+https://github.com/neondatabase/neon-pkgs.git","type":"git"},"description":"Runtime helpers for Neon Functions: `waitUntil` for deferring async work past a response, `upgradeWebSocket` for serving WebSockets from a fetch handler or a Hono route, `attachDatabasePool` for node-postgres idle-client errors, and `parseTriggerDelivery`","maintainers":[{"name":"andrelandgraf","email":"andre.timo.landgraf@gmail.com"},{"name":"neonteam","email":"andre@neon.tech"}],"readme":"# @neon/functions\n\nRuntime helpers for [Neon Functions](https://neon.com):\n\n- **`waitUntil`** — defer background work past a response.\n- **`upgradeWebSocket`** — serve WebSockets from a `fetch` handler, or from a\n  [Hono](https://hono.dev) route via `@neon/functions/hono`.\n- **`attachDatabasePool`** — keep a module-scope `pg.Pool` from killing the isolate when Postgres drops an idle client.\n- **`parseTriggerDelivery`** — parse a Function Trigger delivery (`@neon/functions/triggers`), including schedule and `storage_object_created`. `parseTriggerInvocation` and Hono `parseTrigger(c)` remain schedule-only.\n\n## Install\n\n```bash\nnpm install @neon/functions\n```\n\nFor the Hono route helper, install Hono alongside it:\n\n```bash\nnpm install @neon/functions hono\n```\n\n> **Requirements:** Node.js >= 20.19. The `@neon/functions/hono` subpath declares\n> `hono` `^4.7.8` as an optional peer — installing `@neon/functions` on its own\n> pulls in nothing and warns about nothing.\n\n## `waitUntil`\n\nThe API mirrors [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package): import `waitUntil` and call it directly with the promise you want to keep alive.\n\n```ts\nimport { waitUntil } from \"@neon/functions\";\n\nexport default {\n\tasync fetch(req: Request): Promise<Response> {\n\t\t// Fire-and-forget background work that should outlive the response.\n\t\twaitUntil(logRequest(req));\n\t\treturn new Response(\"ok\");\n\t},\n};\n```\n\n`waitUntil(promise)` forwards the promise to the Neon Functions runtime, which keeps\nthe invocation alive until the promise settles (up to the 15-minute `waitUntil` limit).\nWhen no invocation context is in scope — local dev, tests, or any non-Neon host — it is\na **no-op**: the promise is accepted and ignored (it still runs on its own, it just\nisn't tracked), so the same code runs everywhere without branching. Passing a\nnon-`Promise` throws a `TypeError`.\n\n## `upgradeWebSocket`\n\nTurn an incoming WebSocket handshake into a live connection from inside your normal\n`fetch` handler. The API mirrors\n[`Deno.upgradeWebSocket`](https://docs.deno.com/api/deno/~/Deno.upgradeWebSocket):\n\n```ts\nimport { upgradeWebSocket } from \"@neon/functions\";\n\nexport default {\n\tasync fetch(req: Request): Promise<Response> {\n\t\tif (req.headers.get(\"upgrade\")?.toLowerCase() !== \"websocket\") {\n\t\t\treturn new Response(\"expected a websocket upgrade\", { status: 426 });\n\t\t}\n\n\t\tconst { socket, response } = upgradeWebSocket(req);\n\t\tsocket.addEventListener(\"message\", (event) => socket.send(event.data));\n\t\treturn response;\n\t},\n};\n```\n\n`socket` is a standard [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket),\nso both `addEventListener` and the `onmessage`/`onopen`/`onclose`/`onerror` properties work.\nIt is still `CONNECTING` when you get it: the runtime writes the `101` only once your\nhandler returns `response`, and the socket opens (firing `open`) at that point.\n\n**Return `response` unchanged.** A `101` cannot be expressed as a plain `Response` — the\nfetch spec restricts constructed responses to statuses 200–599 — so the runtime hands back\na response object that carries the pending upgrade. Cloning it, or rebuilding it\n(`new Response(res.body, res)`, which response-rewriting middleware does), discards the\nupgrade; the runtime detects that and fails the request loudly rather than leaving your\nclient waiting on a connection nobody upgraded.\n\n### Subprotocols\n\nPass `protocol` to select one of the subprotocols the client offered, which is echoed back\nin `Sec-WebSocket-Protocol`:\n\n```ts\nconst { socket, response } = upgradeWebSocket(req, { protocol: \"chat.v2\" });\n```\n\nPer [RFC 6455 §4.2.2](https://datatracker.ietf.org/doc/html/rfc6455#section-4.2.2) a server\nmay only select a protocol the client offered, so passing one the client did not offer\nthrows a `TypeError` instead of producing a handshake the client will reject. Omit it and\nno protocol is negotiated: the response header is absent and `socket.protocol` is `\"\"`.\n\n### Notes\n\n- `binaryType` defaults to `\"arraybuffer\"` rather than the browser default of `\"blob\"`,\n  matching Deno and other server runtimes. Setting it to `\"blob\"` is supported.\n- `extensions` is always `\"\"`. No extensions — including `permessage-deflate` — are\n  negotiated.\n- Unlike `waitUntil`, this **throws a `TypeError` off-platform** (and on a request that is\n  not a WebSocket handshake). There is no meaningful degraded WebSocket, so an error that\n  says so beats a socket that could never open.\n\n### Requires a runtime with WebSocket support\n\n`upgradeWebSocket` needs a Neon Functions runtime that provides the upgrade — deployed, or\nlocally under `neon dev`. On an older runtime it throws the \"only available inside a Neon\nFunctions invocation\" `TypeError` rather than misbehaving.\n\n\n## `@neon/functions/hono`\n\nThe same primitive, shaped as Hono's own WebSocket helper, so a route can serve a socket\ndirectly. It is `defineWebSocketHelper` over `upgradeWebSocket` and nothing else — no `ws`\ndependency, and not the deprecated `@hono/node-ws`.\n\n```ts\nimport { Hono } from \"hono\";\nimport { upgradeWebSocket } from \"@neon/functions/hono\";\n\nconst app = new Hono();\n\napp.get(\n\t\"/ws\",\n\tupgradeWebSocket(() => ({\n\t\tonOpen(_event, ws) {\n\t\t\tws.send(\"welcome\");\n\t\t},\n\t\tonMessage(event, ws) {\n\t\t\tws.send(`echo: ${event.data}`);\n\t\t},\n\t\tonClose() {\n\t\t\tconsole.log(\"client disconnected\");\n\t\t},\n\t})),\n);\n\nexport default app;\n```\n\nA request without `Upgrade: websocket` is passed to the next handler, so an ordinary `GET`\non the same path still reaches the route below the helper.\n\nHono awaits your event factory before handing the request to the adapter, so the factory\nruns on those ordinary requests too. Keep it to returning the handler object; if it does\nreal work, do that work inside `onOpen`, where it only runs for a connection that opened.\n\n### Running it\n\n`upgradeWebSocket` needs a runtime that provides the upgrade, so a Hono app serving a socket\nruns under `neon dev` locally and `neon deploy` in production. Serving it yourself with\n`@hono/node-server` will not work — there is no upgrade to claim, and every handshake throws:\n\n```\nTypeError: upgradeWebSocket() is only available inside a Neon Functions invocation.\nRun your function with `neon dev` locally, or deploy it.\n```\n\nKeep `hono` in `dependencies`, not `devDependencies`. `neon deploy` bundles from\n`node_modules` and never reads your manifest, so a devDependency deploys fine from a machine\nwhere it happens to be installed — and breaks on a CI that ran `npm ci --omit=dev`, or on a\nteammate's fresh clone.\n\n### Types\n\nThe subpath exports the types the handlers need, so a factory pulled out of the route does\nnot have to reach into `hono/ws` or remember the type argument:\n\n```ts\nimport type { NeonWSEvents, UpgradeWebSocketOptions } from \"@neon/functions/hono\";\n\nconst createEvents = (): NeonWSEvents => ({\n\tonMessage: (event, ws) => ws.send(`echo: ${event.data}`),\n});\n\nconst options: UpgradeWebSocketOptions = { protocol: \"chat.v2\" };\n```\n\n`NeonWSEvents` and `NeonWSContext` are Hono's `WSEvents` and `WSContext` with `ws.raw`\nalready bound to the platform `WebSocket`. Naming Hono's own types without that argument\nleaves `ws.raw` as `unknown`.\n\n### The direct form\n\nHono's other call form works, when you want the context in hand:\n\n```ts\napp.get(\"/ws\", (c) => upgradeWebSocket(c, { onMessage: (e, ws) => ws.send(`echo: ${e.data}`) }));\n```\n\n**This form is what the `hono` `^4.7.8` requirement is for.** Below that version\n`defineWebSocketHelper` implements only the middleware form, so the call returns a\nmiddleware function instead of upgrading. The client gets a 500, nothing reaches `onError`,\nand the runtime logs:\n\n```\nWebSocket upgrade failed:\nTypeError: response.arrayBuffer is not a function\n```\n\nnpm refuses the install; bun installs it silently and pnpm warns and proceeds, so on those\ntwo the version is yours to check. The middleware form above works on any version that has\nthe helper at all.\n\n### Subprotocols\n\nPass `protocol` as the second argument. Nothing is negotiated unless you pass one, and it\nmust be one the client offered:\n\n```ts\napp.get(\"/ws\", upgradeWebSocket(createEvents, { protocol: \"chat.v2\" }));\n```\n\n### Middleware\n\nGating the route is ordinary middleware — read the token or headers and return before\n`next()`:\n\n```ts\napp.use(\"/ws\", async (c, next) => {\n\tif (c.req.query(\"token\") !== expected) return c.text(\"unauthorized\", 401);\n\tawait next();\n});\n```\n\n**Middleware that touches `c.res` before `await next()`, or calls `c.header()` after it,\nbreaks the upgrade.** Hono materialises and rebuilds the response in both cases, and\nrebuilding the 101 discards the pending upgrade. Reading the request is always fine, and so\nis returning your own response before `next()`.\n\n| On an upgrade route | Upgrade survives |\n| --- | --- |\n| `cors()` | no, at any option including the default |\n| reading `c.res` before `await next()`, even without modifying it | no |\n| `c.header(...)` after `await next()` | no |\n| `secureHeaders()`, `logger()`, `requestId()`, `timing()`, `bodyLimit()` | yes |\n| `c.header(...)` before `await next()` | yes, but the header is dropped from the 101 |\n| reading `c.res` after `await next()` | yes |\n\nWhen it breaks, the first thing you see comes from inside Hono and names none of this:\n\n```\nRangeError: init[\"status\"] must be in the range of 200 to 599, inclusive.\n```\n\nUnder `neon dev`, the runtime logs `websocket_upgrade_response_lost` behind it with\nthe `cors()` / `c.res` / `c.header()` wording from this PR. The deployed runtime\nstill carries its own copy of that string until it ships separately.\n\n### Lifecycle\n\nA WebSocket is a request that returns a `101`, so it lives under the same rules as any other\nNeon Function invocation:\n\n- **Each connection keeps its isolate alive**, and a connection exchanging no bytes for 15\n  minutes may be terminated. Protocol ping/pong counts as activity; the runtime answers\n  pings without involving your handlers.\n- **Isolates are evictable.** In-memory state does not survive, and clients are expected to\n  reconnect. Durable state belongs in Postgres.\n- **Connections are local to the isolate that accepted them.** A module-scope `Set` of\n  connected clients only reaches the clients on that isolate — which is every client under\n  `neon dev`, where there is one, and a fraction of them deployed, where there are several.\n  Broadcasting across isolates needs an out-of-band channel: Postgres `LISTEN`/`NOTIFY` over\n  the unpooled connection to start with, serverless Redis Pub/Sub when the per-isolate idle\n  connection becomes the cost.\n\n### Notes\n\n- `ws.raw` is the underlying `WebSocket`, for anything the Hono context does not surface.\n- `ws.binaryType` is Hono's own field and does not propagate to the socket. Both default to\n  `\"arraybuffer\"`, so inbound binary arrives as an `ArrayBuffer`; set `ws.raw.binaryType` if\n  you need to change it.\n- **`ws.send(event.data)` does not type-check.** Hono types inbound data as\n  `string | Blob | ArrayBufferLike` while `send` refuses a `Blob`, so echoing the raw value\n  back is an error even though the runtime only ever delivers a `string` or an `ArrayBuffer`\n  unless you asked for `\"blob\"`. Interpolate it, or narrow it, before sending it back.\n- `SendOptions.compress` is ignored: no extensions are negotiated.\n- Importing both helpers into one file needs an alias — the root export and this one share\n  the name `upgradeWebSocket`.\n\n## `attachDatabasePool`\n\nA Neon Function reuses a `pg.Pool` across requests on the same isolate. When Postgres\ncloses an idle client — compute scale-to-zero, pooler reclaim, a TCP reset — node-postgres\nemits `error` on the pool. With no listener, that is an uncaught exception and the isolate\nexits.\n\nCall this once after constructing the pool. The pool has already discarded the dead client;\nthe next checkout opens a new connection.\n\n```ts\nimport { attachDatabasePool } from \"@neon/functions\";\nimport { Pool } from \"pg\";\n\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\nattachDatabasePool(pool);\n```\n\nThis helper does not need a Neon Functions runtime. The same call works in plain Node\nand under `neon dev`.\n\nExpected idle disconnects (`ECONNRESET`, `EPIPE`, `ETIMEDOUT`, Postgres `57P01`, and\nnode-postgres's `Connection terminated unexpectedly`) are silent. Anything else is\nlogged with `console.error`.\n\nTo send unexpected errors to your own reporter instead of `console.error`, pass it on\nthe first call, next to `new Pool`:\n\n```ts\nimport * as Sentry from \"@sentry/node\";\nimport { attachDatabasePool } from \"@neon/functions\";\nimport { Pool } from \"pg\";\n\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\nattachDatabasePool(pool, {\n\tonUnexpectedError: (err) => Sentry.captureException(err),\n});\n```\n\nThe first call wins. A second `attachDatabasePool(pool)` is a no-op. A second call that\npasses `onUnexpectedError` is also a no-op and logs a warning.\n\nIf `onUnexpectedError` throws, or returns a promise that rejects, both the pool error and\nthe reporter error are logged. Neither is rethrown from the listener, so the isolate stays up.\n\nThis does not close the pool. Isolate teardown tears the connections down with the process.\n\n## Function Trigger deliveries\n\nA [Function Trigger](https://neon.com/docs/cli/triggers) POSTs JSON to your function.\n`parseTriggerInvocation` is schedule-only: it checks `x-neon-trigger-invocation-id`\nagainst `invocation_id` and returns a `TriggerInvocation` (`ScheduleTriggerInvocation`).\nStorage-object-created deliveries use `parseTriggerDelivery`, which returns a\n`TriggerDelivery`. Schedule members of that union have `type: \"schedule\"`, so\nboth `if (invocation.type === \"schedule\")` and\n`if (invocation.type === \"storage_object_created\")` narrow `data`.\n\n```ts\nimport { parseTriggerDelivery } from \"@neon/functions/triggers\";\n\nexport default {\n\tasync fetch(request: Request): Promise<Response> {\n\t\tconst parsed = await parseTriggerDelivery(request);\n\t\tif (!parsed.ok) {\n\t\t\tconst status = parsed.error === \"invalid_body\" ? 400 : 401;\n\t\t\treturn new Response(parsed.error, { status });\n\t\t}\n\n\t\tconst invocation = parsed.invocation;\n\t\tif (invocation.type === \"storage_object_created\") {\n\t\t\treturn Response.json({\n\t\t\t\tbucketName: invocation.data.bucketName,\n\t\t\t\tobjectKey: invocation.data.objectKey,\n\t\t\t});\n\t\t}\n\n\t\treturn Response.json({\n\t\t\tscheduledAt: invocation.data.scheduledAt,\n\t\t});\n\t},\n};\n```\n\n`parseTriggerDelivery(request)` and `parseTriggerInvocation(request)` check the\nheader first, then clone the Request and read JSON from the clone, so\n`request.json()` still works afterwards.\n\nIf you already have the JSON:\n\n```ts\nconst body = await request.json();\nconst parsed = parseTriggerDelivery({\n\theaders: request.headers,\n\tbody,\n});\n```\n\nOn success, `parsed.invocation` is camelCase: `invocationId`, `trigger.id`,\n`trigger.name`, `trigger.type`. `parseTriggerDelivery` also sets a top-level\n`type`. Schedule deliveries have `data.scheduledAt`. Storage-object-created\ndeliveries have `data.bucketName` and `data.objectKey`. Narrow on\n`invocation.type` (or use `isScheduleTriggerInvocation` /\n`isStorageObjectCreatedTriggerInvocation`) before reading `data` — a check on\n`trigger.type` does not narrow the sibling `data` field.\n\nOn failure, `parsed.error` is `missing_header`, `invalid_body`, or\n`invocation_id_mismatch`. Invalid JSON on the Request path is `invalid_body`.\nUnknown `trigger.type` values fail as `invalid_body` until this package adds them.\n\n### `parseTrigger` (Hono)\n\n`parseTrigger(c)` runs the Request overload on `c.req.raw` and throws\n`HTTPException`. `c.req.json()` still works afterwards. It returns a\n`ScheduleTriggerInvocation`, so existing `invocation.data.scheduledAt`\ncallers keep compiling. A `storage_object_created` delivery is\n`invalid_body`; parse those with `parseTriggerDelivery(c.req.raw)`.\n\n| Failure | Status | Message |\n| --- | --- | --- |\n| missing header | 401 | `Missing x-neon-trigger-invocation-id header` |\n| header ≠ `invocation_id` | 401 | `Invocation id mismatch` |\n| invalid JSON or payload | 400 | `Invalid trigger payload` |\n\n```ts\nimport { Hono } from \"hono\";\nimport { parseTrigger } from \"@neon/functions/hono\";\n\nconst app = new Hono();\n\napp.post(\"/cron\", async (c) => {\n\tconst invocation = await parseTrigger(c);\n\treturn c.json({ ok: true, scheduledAt: invocation.data.scheduledAt });\n});\n```\n\n```ts\nimport { parseTriggerDelivery } from \"@neon/functions/hono\";\n\napp.post(\"/object\", async (c) => {\n\tconst parsed = await parseTriggerDelivery(c.req.raw);\n\tif (!parsed.ok) {\n\t\tconst status = parsed.error === \"invalid_body\" ? 400 : 401;\n\t\treturn c.text(parsed.error, status);\n\t}\n\tif (parsed.invocation.type !== \"storage_object_created\") {\n\t\treturn c.text(\"invalid_body\", 400);\n\t}\n\treturn c.json({\n\t\tbucketName: parsed.invocation.data.bucketName,\n\t\tobjectKey: parsed.invocation.data.objectKey,\n\t});\n});\n```\n\n## Runtime integration\n\nThe runtime publishes the active invocation context on `globalThis.NEON_REQUEST_CONTEXT`\nas a getter that returns the live context object directly — `{ waitUntil }` during an\ninvocation, `undefined` outside one. `waitUntil` reads that value straight off the\nglobal, so there is nothing for application code to wire up.\n\n`upgradeWebSocket` works the same way, reading a bridge the runtime publishes under\n`Symbol.for(\"neon.websocket.bridge\")`. All of the protocol work — the handshake, framing,\nfragmentation, ping/pong and the close handshake — lives in the runtime; this package is\nonly a typed facade over it.\n","readmeFilename":"README.md"}