neon-functions
Fungsinya
Neon Functions memungkinkan Anda membuat dan menjalankan kode (disebut 'functions') yang berjalan dekat dengan database Anda. Fitur ini cocok untuk tugas yang perlu tetap aktif lebih lama dari biasanya dan perlu mengakses data dengan cepat.
Kapan dipakai
- βSaat Anda membutuhkan kode yang 'mendengarkan' dalam waktu lebih lama, misalnya untuk chat.
- βUntuk membuat koneksi yang mengirim pembaruan real-time ke pengguna.
- βSaat kode Anda perlu mengakses database berkali-kali dengan cepat.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/neon-functions/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara membuat function yang merespons web request dan tetap terhubung ke database saya?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Anda menulis kode dengan Node.js lalu menggunakan tool Neon untuk men-deploy-nya. Neon yang menangani proses menjalankannya dekat dengan data Anda, dan memberi Anda alamat untuk mengaksesnya melalui internet.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Neon Functions
This is a preview feature and only available in us-east-2. Neon Functions are long-running Node.js HTTP handlers deployed onto a Neon branch. Each function gets a public HTTPS URL, runs in the same region as your database, and β if the branch has Postgres β gets DATABASE_URL injected automatically. You deploy and manage them through the same Neon CLI, neon.ts, and API you already use.
Use this skill to help the user define, run locally, deploy, and manage functions next to their database. Deliver a deployed function with its invocation URL, a working local neon dev loop, or a precise answer from the official Neon docs.
When to Use
Reach for Neon Functions when the workload is a request/response handler that benefits from staying alive and staying close to the data:
- Long-running request/response flows that outlast lambda-style limits. Agents that make several LLM calls and tool invocations per request, or image/video generation, routinely blow past the ~10β60s execution caps and short streaming windows of traditional serverless functions. Neon Functions are long-running: the handler just needs to start responding within 15 minutes, and an open stream stays alive as long as bytes keep flowing. That's enough headroom for real agent workloads.
- Stateful streaming without bolting on Redis. Because a function stays alive across a request, it can host an SSE endpoint or a WebSocket server and hold the connection open in-process β no external state store (Redis, etc.) needed just to keep a stream coherent. Module-scope state (a
pgpool, an in-memory counter) persists across requests on the same isolate. - Compute that must sit next to Postgres. The function runs in the same region as the branch's database, so there are no cross-region round trips on every query.
DATABASE_URLis injected for you. - A backend that branches with your data. Each branch runs its own version of the function at its own URL, against its own isolated database (and storage, and gateway) state. Preview deployments, CI, and dev environments each get a self-contained backend β deploying to a child never affects the parent.
- Webhooks, bots, and post-response work. Webhook handlers that fan out into multiple DB writes, Discord/WebSocket bots, and fire-and-forget follow-ups via
waitUntil(analytics, audit logs) all fit.
If the workload is a pure static site, a cron/background job that needs its own lifecycle and cancellation, or something that must run outside us-east-2 today, this isn't the right tool yet (see Timeouts and Availability below).
What It Does
- Long-running & serverless β Built for WebSocket servers (see WebSocket servers), SSE endpoints (see Server-sent events (SSE)), long agent HTTP streams, and APIs. Still scales to zero when idle.
- Web-standard handler β A function is any default export with a
fetch(request)method returning aResponse(Workers/WinterTC-compatible). A Hono app exports exactly that shape, soexport default appjust works. Runs on Node.js 24, so all Node APIs are available. - Close to your database β Runs in the branch's region;
DATABASE_URLinjected automatically when the branch has Postgres. - Branchable β Each branch runs its own function version at its own URL against its own isolated state.
- Same CLI/API β Deploy and manage via
neon,neon.ts, or the Neon API.
Architecture: where Functions fit
Neon (Functions included) is backend primitives, not full-stack app hosting. Host your app on Vercel (or Netlify, or another frontend/app host); Functions are the long-running, stateful slice of your backend that lives next to your data. They compose with that platform in two ways:
- Add a Function to a full-stack app. Your Next.js / TanStack Start app on Vercel (or Netlify) owns UI, auth (e.g. Neon Auth), and talks directly to Neon Postgres and Object Storage. When one workload outgrows the host's short serverless limits β a WebSocket or SSE server, or a long-running agent that would time out β move just that piece onto a Neon Function. (See Functions as an agent backend for the client-direct pattern.)
β¦
Pertanyaan umum
Apa yang dimaksud 'functions' dalam konteks ini?
Itu adalah program kecil yang Anda buat untuk menjalankan tugas tertentu. Anggap saja sebagai pembantu yang berjalan setiap kali Anda membutuhkannya.
Mengapa 'dekat dengan database' itu penting?
Ini membuat akses data jauh lebih cepat, karena data tidak perlu 'menempuh' jarak jauh untuk diambil atau disimpan.
Apakah ini bisa dipakai untuk semua jenis kode?
Fitur ini paling cocok untuk kode yang perlu tetap aktif dalam waktu lama (seperti chat atau aliran data) dan diuntungkan dengan akses database yang cepat. Fitur ini tidak disarankan untuk tugas yang sangat singkat atau tugas terjadwal (seperti alarm).
Detail
Deskripsi asli dari pembuat
Long-running, serverless Node.js HTTP functions deployed onto your Neon branch, with DATABASE_URL injected automatically and compute that runs next to your data.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #5282
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.