npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ereo/deploy-vercel

v0.2.18

Published

Vercel deployment adapter for EreoJS framework

Readme

@ereo/deploy-vercel

Vercel deployment adapter for the EreoJS framework. Configure and deploy your EreoJS applications to Vercel with support for both Edge and Node.js runtimes.

Installation

bun add @ereo/deploy-vercel

Quick Start

import { defineConfig } from '@ereo/core';
import { vercel } from '@ereo/deploy-vercel';

export default defineConfig({
  ...vercel({
    edge: true,
    regions: ['iad1', 'sfo1'],
  }),
});

API Reference

vercel(config?)

Generates EreoJS framework configuration for Vercel deployment.

Parameters:

  • config (optional): VercelConfig object

Returns: Partial<FrameworkConfig> with build target set

import { vercel } from '@ereo/deploy-vercel';

// Default: Node.js runtime
const nodeConfig = vercel();
// Returns: { build: { target: 'node' } }

// Edge runtime
const edgeConfig = vercel({ edge: true });
// Returns: { build: { target: 'edge' } }

generateVercelJson(config)

Generates a vercel.json configuration file as a JSON string.

Parameters:

  • config: VercelConfig object

Returns: string - Formatted JSON configuration

import { generateVercelJson } from '@ereo/deploy-vercel';

// Node.js configuration
const nodeJson = generateVercelJson({});

// Edge configuration with regions
const edgeJson = generateVercelJson({
  edge: true,
  regions: ['iad1', 'sfo1'],
});

// Write to file
await Bun.write('vercel.json', edgeJson);

Generated JSON Structure (Edge example):

{
  "version": 2,
  "builds": [
    {
      "src": "dist/server.js",
      "use": "@vercel/edge",
      "config": {
        "includeFiles": ["dist/**"]
      }
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "dist/server.js"
    }
  ],
  "regions": ["iad1", "sfo1"],
  "functions": {
    "dist/server.js": {
      "runtime": "edge",
      "regions": ["iad1", "sfo1"]
    }
  }
}

generateBuildScript()

Generates a bash build script for Vercel deployment.

Parameters: None

Returns: string - Bash script content

import { generateBuildScript } from '@ereo/deploy-vercel';

const script = generateBuildScript();
await Bun.write('build.sh', script);

Generated Script:

#!/bin/bash
# Vercel build script for EreoJS framework

set -e

echo "Building for Vercel..."

# Install dependencies
bun install

# Build the application
bun run build

# Copy static assets to dist
mkdir -p dist/public
cp -r public/* dist/public/ 2>/dev/null || true

echo "Build complete!"

VercelConfig Interface

interface VercelConfig {
  /** Use Vercel Edge runtime (default: false = Node.js) */
  edge?: boolean;

  /** Deployment regions */
  regions?: string[];

  /** Function timeout in seconds - Reserved for future use */
  timeout?: number;

  /** Memory allocation in MB - Reserved for future use */
  memory?: number;

  /** Environment variables - Reserved for future use */
  env?: Record<string, string>;
}

| Option | Type | Used By | Description | |--------|------|---------|-------------| | edge | boolean | vercel(), generateVercelJson() | Use Edge runtime instead of Node.js | | regions | string[] | generateVercelJson() | Vercel deployment regions | | timeout | number | Reserved | Function timeout (not yet implemented) | | memory | number | Reserved | Memory allocation (not yet implemented) | | env | Record<string, string> | Reserved | Environment variables (not yet implemented) |

Default Export

The package default export is the vercel function:

import vercel from '@ereo/deploy-vercel';
// Equivalent to: import { vercel } from '@ereo/deploy-vercel';

Deployment

Using Vercel CLI

# Build the application
bun run build

# Deploy to Vercel
vercel deploy

# Deploy to production
vercel deploy --prod

Generate Configuration Files

import { generateVercelJson, generateBuildScript } from '@ereo/deploy-vercel';

// Generate vercel.json
const vercelConfig = generateVercelJson({ edge: true, regions: ['iad1'] });
await Bun.write('vercel.json', vercelConfig);

// Generate build script
const buildScript = generateBuildScript();
await Bun.write('build.sh', buildScript);

Runtime Comparison

| Feature | Node.js Runtime | Edge Runtime | |---------|----------------|--------------| | Builder | @vercel/node | @vercel/edge | | Max Timeout | 900 seconds | 30 seconds | | Memory Range | 128-3008 MB | 1024-4096 MB | | Node.js APIs | Full support | Limited | | Cold Start | Slower | Faster |

Current Limitations

The following config options are defined in the interface but not yet implemented:

  • timeout - Function timeout configuration
  • memory - Memory allocation configuration
  • env - Environment variables

These options are accepted for future compatibility but do not affect the generated output.

Documentation

For full documentation, visit https://ereojs.github.io/ereoJS/api/deploy/vercel

Part of EreoJS

This package is part of the EreoJS monorepo.

License

MIT