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

@brendonovich/vercel-rust

v0.0.0-main-08f8cde

Published

Rust runtime for Vercel Functions.

Readme

Community-maintained package to support using Rust inside Vercel Functions as a Runtime.

Legacy Runtime

The below documentation is for the vercel_runtime crate (in beta). If you are looking for the legacy runtime instructions using vercel_lambda see tree/a9495a0.

Usage

First, you'll need a vercel.json file in your project:

{
  "functions": {
    "api/**/*.rs": {
      "runtime": "[email protected]"
    }
  }
}

A Vercel Function will be created for every file that matches api/**/*.rs.

Example:

use serde_json::json;
use vercel_runtime::{run, Body, Error, Request, Response, StatusCode};

#[tokio::main]
async fn main() -> Result<(), Error> {
    run(handler).await
}

pub async fn handler(_req: Request) -> Result<Response<Body>, Error> {
    Ok(Response::builder()
        .status(StatusCode::OK)
        .header("Content-Type", "application/json")
        .body(
            json!({
              "message": "你好,世界"
            })
            .to_string()
            .into(),
        )?)
}

Finally we need a Cargo.toml file at the root of your repository.

# --snip--

[dependencies]
# --snip--
# Documentation: https://docs.rs/vercel_runtime/latest/vercel_runtime
vercel_runtime = { version = "0.2.1" }

# You can specify a library for shared logic here (optional)
# [lib]
# path = "src-rs/lib.rs"

# Each handler has to be specified as [[bin]]
[[bin]]
name = "handler"
path = "api/handler.rs"

# Note that you need to provide unique names for dynamic paths
[[bin]]
name = "user-id"
path = "api/user/[id].rs"

[[bin]]
name = "group-id"
path = "api/group/[id].rs"


# --snip--

Dependencies

This Builder supports installing dependencies defined in the Cargo.toml file.

Furthermore, more system dependencies can be installed at build time with the presence of a shell build.sh file in the same directory as the entrypoint file.

Local Development

With vercel dev and vercel-rust, you can develop your Rust-based lambdas on your own machine.

During local development with vercel dev, ensure rust and cargo are already installed and available in your PATH, since they will not be installed automatically. The recommended way to install is with rustup.

Contributing

Since this project contains both Rust and Node.js code, you need to install the relevant dependencies. If you're only working on the JavaScript side, you only need to install those dependencies (and vice-versa).

# install node dependencies
pnpm install


# install cargo dependencies
cargo fetch

Invocation Flowchart

graph TD
    A["Lambda Invocation"] --> |"process_request(event: LambdaEvent&lt;VercelEvent&gt;) → Request"| B[Request]
    B --> |"handler_fn(req: Request) → Future&lt;Output = Result&lt;Response&lt;Body&gt;, Error&gt;&gt;"| C["Runtime calls handler_fn"]
    C --> |"Ok(r) => process_response(r)"| D["Response"]

FAQ

Unfortunately, the AWS Lambda Runtime for Rust relies (tangentially) on proc_macro, which won't compile on musl targets. Without musl, all linking must be dynamic. If you have a crate that relies on system libraries like postgres or mysql, you can include those library files with the includeFiles config option and set the proper environment variables, config, etc. that you need to get the library to compile.

For more information, please see this issue.