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

serverless-agnostic

v1.0.2

Published

A Serverless Framework Plugin to build provider agnostic serverless express.js applications.

Downloads

16

Readme

serverless-agnostic

A Serverless Framework Plugin to build provider agnostic serverless express.js applications. This plugin uses jscodeshift to perform transpilations(source-to-source compilations) in Javascript files, in order to adapt them to work with the different serverless providers. The library serverless-httpis also used for enabling express routing in AWS Lambda specific handler format.

1. Installation

Run npm install in your Serverless project.

npm install --save-dev serverless-agnostic

Add the plugin to your serverless.yml file

plugins:
  - serverless-agnostic

2. Configuration

In order to use serverless-agnostic there should be one main .serverless configuration file for the plugin settings and one yaml file for each provider, in this provider yaml files there should be all Serverless Framework configuration required for that specific provider. The suggested name pattern for these files is .serverless-{{PROVIDER_NAME}}.yml.

Sample folder structure for the project:

.
├── ...
  ├── resources                   # sample files
  │   └── sample.png               
  ├── services                   
  │   └── hello-world.js
  ├── index.js
  ├── .serverless-gcp.yml         # GCP serverless config file
  ├── .serverless-aws.yml         # AWS serverless config file
  └── .serverless                 # main serverless config file

Plugin Setup

The main .serverless file should have the plugin specific variables declared in the custom attributes section, under the serverlessAgnostic object. Here's an example of a .serverless file:

custom:
  serverlessAgnostic:
    serverFile: index.js
    handlerName: myHandler
    serverName: app
    providers:
      - name: aws
        slsFilePath: serverless.aws.yml
      - name: gcp
        slsFilePath: serverless.gcp.yml

Atributes

| Attribute | Description | |-----------------------|------------------------------------------------------------------------------------------------------------------------------| | serverFile | Consists of the name/path of the file that contains your express.js application. | | handlerName | The name of the handler you're exporting in the module(It should match the handler name in your provider specific yaml file) | | serverName | Consists of the variable name used for the express.js application object(usually is app) | | providers.name | Refers to the name of the provider(e.g. aws) | | providers.slsFilePath | Refers to the name/path of the file that contains the specific configuration for the provider |

3. Commands

Compile

The compile command its very straight foward, it compiles your code into the format accepted by the providers you specified in the providers attribute. The default behavior is to compile for all providers, but if you want to compile for one or more specific providers than you can user the --provider or -p flag. The generated files will be stored inside a file called .serverless-agnostic.

For all providers

serverless compile

For specific providers

serverless compile --provider aws

Agnostic Deploy

The agnostic deploy command executes the Serverless Framework deploy for each provider declared, using the configuration described in the provider specific yaml files. The default behavior is to compile for all providers, but if you want to deploy for one or more specific providers than you can user the --provider or -p flag.

For all providers

serverless agnosticDeploy

For specific providers

serverless agnosticDeploy --provider gcp

4. Providers

Currently, the project only supports Amazon Web Services and Google Cloud Platform.