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

aws-lambda-fusion

v0.2.8

Published

Runtime data based framework for function fusion

Readme

aws-lambda-fusion

Installation

npm install aws-lambda-fusion

or

yarn add aws-lambda-fusion

Usage

Framework

This project is part of the Function-Fusion framework.

aws-lambda-fusion exposes two different functions: invokeFunctionSync and invokceFunctionAsync.

CLI

aws-lambda-fusion also comes with two CLI commands.

Create serverless.yml

aws-lambda-fusion -f <url to fusion configuration> -h <name of handler, default: fusionHandler>

Create directed acyclic graph JSON file

aws-lambda-fusion -d <root of your project>

Usage

First, you need to manually create a deployment configuration. By default every logical function should be inside its own deployment unit, i.e., for every function there is its own lambda. Upload this file to a S3 bucket of your choice and make it publically available.

Example

If your application has 3 functions:

[
  {
    "entry": "handler0",
    "lambdas": ["function1"]
  },
  {
    "entry": "handler1",
    "lambdas": ["function2"]
  },
  {
    "entry": "handler2",
    "lambdas": ["function3"]
  }
]

The entry property specifies which AWS Lambda should be invoked.

Afterward, you need to create an entry handler for any incoming requests. This handler delegates requests to the correct target function.

exports.handler = async (event, context, callback) => {
  let traceId = ''

  // fetch deployment configuration from remote
  const response = await fetch('https://example.com/fusionConfiguration.json')
  const fusionConfiguration = await response.json()

  // create new traceId if none exists
  if (event.traceId) {
    traceId = event.traceId
  } else {
    traceId = uuid()
  }

  const target = event.target
  const source = event.source

  if (!target) {
    throw Error('Error. No target found in event', event)
  }

  const fusion = new FunctionFusion(
    fusionConfiguration,
    {
      region: 'eu-central-1',
    },
    __dirname
  )
  let args = []
  if (event.args) {
    args = [...event.args]
  }

  return fusion.invokeFunctionSync(
    { source, target, context, traceId },
    ...args
  )
}

Finally, every AWS handler needs to be wrapped inside the handlerWrapper function that is exported by this library. handlerWrapper adds traceId logs at the start and end of the Lambda invocation. This is needed for the log-aggregator to work. Invoke other functions by using either invokeFunctionSync or invokeFunctionAsync.

const { handlerWrapper } = require('aws-lambda-fusion')

const handler = async (event, context) => {
  const traceId = event.traceId

  // fetch deployment configuration from remote
  const response = await fetch('http://example.com/fusionConfiguration.json')
  const fusionConfiguration = await response.json()

  //create fusion object
  const fusion = new FunctionFusion(
    fusionConfiguration,
    {
      region: 'eu-central-1',
    },
    __dirname
  )

  // invoke other function
  const response = await fusion.invokeFunctionSync(
    {
      source: '<name of source function>',
      target: '<name of target function>',
      context,
      traceId,
    },
    payload
  )
}

exports.handler = async handlerWrapper(event, context, callback) => {
  const traceId = event.traceId;
  return handlerWrapper({
    event,
    context,
    callback,
    handler: internalHandler,
    traceId,
    lambdaName: 'name of source function',
  });
}

Deployment

Prerequisites

Step 1

Generate a serverless.yml

aws-lambda-fusion -f <url to fusion configuration> -h <name of handler, default: fusionHandler>

The -h option should point to the entry handler you created in the previous step. By default the entry handler is named fusionHandler. This creates a serverless.yml file. You might need to adjust iamRoleStatements according to your needs.

Step 2

The Optimizer needs a Github Action to trigger a deployment from. You can do this easily with our CLI:

aws-lambda-fusion --github-actions

Afterward, add your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to your repository's secrets.

Step 3

Deploy your application to staging

serverless deploy --stage stg

Step 4

If you deployed the Optimizer and Feedback framework previously you are done. Otherwise, refer to their README's on how to install and deploy them.