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-flow-plugin

v0.0.9

Published

A lightweight testing framework for the Serverless Framework.

Downloads

11

Readme

Serverless-Flow

A lightweight testing framework for the Serverless Framework.

Features

  • Write mock events and invoke your functions with them while you write code.
  • On save, this plugin automatically invokes your Function w/ each mock event and prints results in your console.
  • Features a local or remote mode. remote mode will quickly deploy your function before invoking it with mock data.
  • Write multiple mock events for each event for your functions.

Quick-Start

Install with npm:

npm i serverless-flow-plugin --save

Add it to your Serverless Service plugins:

plugins
  - serverless-flow-plugin

Add a mock property to your Functions:

# serverless.yml

functions
  hello
    handler: index.hello
    events:
      - http:
          path: hello
          method: get
          mocks: ${file(./mocks.yml):hello} # References to another file which contains the mocks

Create a mocks.yml file in your service folder:

# mocks.yml

hello_http: # Contains the mock for the "hello" function and "http" event
  succcess: # A mock for this function event
    query:
      clientId: aslkfjasf8kajsf981
  fail: # Another mock for this function event
    query:
      clientId: false

Start the plugin:

sls flow --function hello

Write code, hit save, and your function will be auto-invoked for each mock.

When you're done working locally, switch the mode to remote to test your mocks against live Lambdas

sls flow --function hello --mode remote // Remote mode invokes the function on Lambda