Langsung ke konten
Skillpedia
API & server (backend)48k Β· #5282

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.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/neon-functions/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

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 pg pool, 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_URL is 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 a Response (Workers/WinterTC-compatible). A Hono app exports exactly that shape, so export default app just works. Runs on Node.js 24, so all Node APIs are available.
  • Close to your database β€” Runs in the branch's region; DATABASE_URL injected 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.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5282
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa