Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bun-vercel

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-vercel

Run [Bun](https://bun.sh) on Vercel Serverless Functions

  • 1.0.0-alpha.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bun-vercel

Run Bun on Vercel Serverless Functions

https://bun-vercel.vercel.app/

This is an experimental project and should not be used in production. This project is not endorsed by Vercel.

// src/main.ts
import { type Server } from "bun"

export default {
  async fetch(request: Request, server: Server) {
    return new Response("Hello from Bun on Vercel", {
      status: 200,
      headers: { "Content-Type": "text/plain" }
    })
  }
}

Get Started

There are two ways to deploy your project to Vercel:

  1. GitHub integration
  2. Manually from your computer

GitHub Integration

Note: An issue in Bun must be resolved before this method is fully operational

1. Update your package.json with bun-vercel
{
  "devDependencies": {
    "bun-vercel": "^1.0.0-alpha.4",
  }
}
2. Update the build script run bun-vercel
{
  "scripts": {
    "build": "bun-vercel ./src/main.ts"
  }
}
3. Add a vercel.json with your build command
{
  "buildCommand": "bun run build"
}

Manually

Before starting you should follow the same setup steps as the GitHub integration, as they will be needed regardless.

Note: To deploy from your computer you must have Docker installed so we can build for Amazon Linux

  1. Install the Vercel CLI and run vercel link
  2. Run bun run build
  3. Run vercel deploy --prebuilt --prod

FAQs

Package last updated on 02 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc