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

v0.1.2

Published

Keep lambda functions nice and toasty

Downloads

23

Readme

npm downloads total npm version npm license Build Status

Installation

npm install serverless-plugin-ignitor --save-dev

or

yarn add serverless-plugin-ignitor --dev

Usage

In the serverless file, add serverless-plugin-ignitor within the plugins entry.

Example:

functions:
  hello:
    handler: src/hello.handler
    timeout: 15

plugins:
  - serverless-plugin-ignitor

By default all functions will then be automatically scheduled, wrapped to accept scheduled events, and immediately invoked post-deployment. If you want more granular control, options can be configured within a custom ignitor variable.

Options

The plugin provides the following configurations per matching keys.

| Option | Values | Default | Description | | :--- | :--- | :--- | :--- | | schedule | Boolean or Object | null | Controls whether the lambda should be scheduled | | wrapper | String | null | The file path where a custom wrapper exists (same as a function handler definition) |

Options Example

custom: 
  ignitor:
    hello:
      wrapper: wrappers.logger
      schedule:
        rate: rate(3 minutes)
        enabled: true
        input: 
          source: 'logger'

    # regular expressions can be used
    /good.*/: 
      schedule: false 
      
    /non-matching/:
      schedule: true

functions:
  hello:
    handler: handlers.hello
    timeout: 10
  goodbye:
    handler: handlers.goodbye

plugins:
  - serverless-plugin-ignitor
  - serverless-webpack

Custom Schedule

If you want to build a custom schedule and do not include a custom input event, the default ignitor event will be used.

Custom Wrapper

If you want to build a custom wrapper instead of the default ignitor wrapper, it needs to be written like a higher-order-function.

Example:

// wrappers.js
const logger = (original) => (evt, ctx, cb) => {
  console.log('Logging event data:', JSON.stringify(evt, null, 2));
  return original(evt, ctx, cb);
}

module.exports = {
  logger,
};

Plugin Conflicts

Make sure serverless-plugin-ignitor is placed before any plugins that compile code. Example:

plugins:
  - serverless-plugin-ignitor
  - serverless-webpack

Cost

Cost per execution: $0.0000002

Cost per memory allocated 1024MB: $0.000001667

Calls per day: 288

Calls per month: 8640

Total monthly cost per-lambda: $0.016

**Prices calculated using the following aws information here.