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

@khadga/serverless-fe2o3

v0.1.0

Published

serverless framework plugin for rust

Readme

serverless-fe2o3

A serverless framework plugin for rust

Prerequisites

fe2o3 is currently geared towards building in a docker based environment and thus requires either docker engine for linux, or docker desktop for macos and windows. It also assumes that your rust project is using the aws-rust-runtime

What does it do?

serverless-fe2o3 (henceforth fe2o3) is a plugin for the serverless framework that allows you to have a cargo based rust project, and build it in the same execution environment as the AWS provided.al2 environment.

The plugin adds some new options for ther serverless.yml file so that the plugin knows what it needs to do. The plugin will build your binary and bundle it for you by hooking in before either the sls package or sls deploy commands. It rebames your executable to bootstrap and zips it up to lambda.zip (by default) as required by the AWS custom runtime.

Optionally, you can provide your own custom Dockerfile and build context environment if you wish to create your own rust builder.

serverless yaml file

Some new variables to the serverless.yml file are now recognized

plugins:
  - serverless-fe2o3

custom:
  # Contains "global" rust config values
  rust:
    target: x86_64-unknown-linux-gnu   # Optional, defaults to x86_64-unknown-linux-gnu
    toolchain: stable                  # Optional, defaults to stable     
    version: 1.57.0                    # Required if not set under functions
    src_dir: /path/to/project          # Optional, defaults to directory npx sls command is run
  docker:
    build: true                        # Optional. build the docker image defaults to false
    context: /path/to/build/context    # The build context path.
    tag: ""                            # Optional  docker tag.  defaults to fe2o3
    extras: []                         # optional. other packages to install
    
functions:
  fn-name:
    handler: package-name               # Required the cargo package
    tags:
      runtime: rust                     # required
      version: 1.55.0                   # Optional: rustc version to use
      target: x86_64-unknown-linux-gnu  # Optional: target triple
      toolchain: beta                   # optional:
      src_dir: /path/to/project         # required if different from rust.src_dir
  fn2:
    handler: other-package

The custom.rust map sets a serverless-wide configuration for various rust related information, such as what rustc version to use, the target (rustc target triple) or optional toolchain (eg, beta or nightly). These values will be overridden in each function.name.tags map if those are provided. This allows you to have different functions that compile against different toolchains.

The only required field is the function.name.handler which should match the cargo package name. If you have a cargo workspace project, it knows which member to build and bundle. If it's a regular cargo project, it should just match the package name. In aws provider.al2 runtime with the aws-lambda-runtime project, the handler name typically doesn't matter. We just use it here

The custom.docker options set whether you wish to build your rust binary and zip bundle using your own Dockerfile and build context.

Why not serverless-rust?

I owe the serverless-rust plugin for helping me understand how to build a serverless franework plugin, but I noticed that it was not using the official AWS aws-lambda-provded image as the base image to build from. It was also still trying to compile against the musl target instead of the gnu target. The default image it uses for building was last updated in early 2021, and it uses rustc version 1.45 which is far too old for some things.

However, serverless-rust does provide for building locally, which is something this plugin does not yet do.