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 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-go-build-extended

v0.1.3

Published

Serverless plugin to build your go binaries, extended for compatibility with serverless-offline.

Downloads

5

Readme

Serverless Go Build Extended (For Compatibility with Serverless Offline)

Forked from Sean Keenan's super helpful serverless-go-build repository.

This version of the repository has an additional configuration option, useBinPathForHandler.

custom:
  go-build:
    useBinPathForHandler: true
functions:
  getWidget:
    handler: bin/entrypoints/widget/main
    events:
      - http:
          path: widget
          method: get

When useBinPathForHandler is set to true, the plugin will assume that the path set in your functions section of the serverless.yml file refers to the resulting build location, and not the source Go file.

If you set your handler to bin/hello/main, it will assume that the source Go file is at hello/main.go.

You can set binPath to a custom folder name. However, you must also make sure to use that folder name in the handler name if used in conjunction with useBinPathForHandler.

custom:
  go-build:
    useBinPathForHandler: true
    binPath: compiled
functions:
  getWidget:
    handler: compiled/entrypoints/widget/main
    events:
      - http:
          path: widget
          method: get

The above will look for a Go file at entrypoints/widget/main.go, and then compile it to compiled/entrypoints/widget/main.

But why though?

Other plugins such as serverless-offline require that the handler of a function point at the actual binary that needs to be run. The default configuration of serverless-go-build requires you to write the source Go file as the function handler. The use of the new useBinPathForHandler option allows the handler to be set to point at the compiled file as usual, making it possible to use plugins such as serverless-offline.