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

@nexus-navigators/lambda-http-interceptor

v1.2.3

Published

A Node.js http interceptor to invoke Lambda functions

Readme

@nexus-navigators/lambda-http-interceptor

Node.js http interceptor for Lambda HTTP APIs

npm version npm downloads npm version Continuous Integration codecov GitHub issues GitHub pull requests GitHub Repo stars GitHub forks

Intercept HTTP calls that are intended to hit a Lambda that resolves API Gateway requests. Use cases include unit tests, integration tests, or connecting directly to a Lambda while bypassing API Gateway.

Installation


npm i --save @nexus-navigators/lambda-http-interceptor

Usage



import { enable, clear, registerIntercept } from '@nexus-navigators/lambda-http-interceptor'

const handler = (event: APIGatewayProxyEventV2) => {
  console.log(event)
  return {
    status: 200,
    body: { out: 'OK' },
  }
}

enable()
registerIntercept({
  eventType: 'apiGatewayProxyV1',
  listenerType: 'handler',
  eventHandler: handler,
  hostMatch: /.*lambda-function\.com.*/,
  eventParams: {
    binaryTypes: [],
  },
  contextParams: {
    functionName: 'testFunction',
    timeout: 1,
  }
})

const response = await fetch('https://lambda-function.com/test')

assert.equal(response.status, 200)
const json = await response.json()
assert.equal(json.out, 'OK')

API


Register Options

| Option | Description | |-----------------|---------------------------------------------------------------------------------------------------------------------------------------| | eventType | The type of event to be sent to the Lambda function. Can be apiGatewayProxyV1 or apiGatewayProxyV2. | | listenerType | The type of listener to be used for invoking the Lambda function. Can be handler or sdk. | | eventHandler | When listenerType is handler then a Lambda handler function must be provided | | hostMatch | A string or RegExp used to match hosts for requests. Can be blank if all HTTP requests should be sent to the function. | | eventParams | An object containing API Gateway parameters to be passed to the Lambda function. | | contextParams | An object containing Lambda context parameters to be passed to the Lambda function. Required when setting listenerType to handler |

Event Parameters

| Parameter | Description | |-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | binaryTypes | An array of binary types to be passed to the Lambda function. The interceptor will convert these kinds of requests to base64 and set the APIGateway event flag | | authorizer (optional) | Any authorization parameters that the API Gateway would have added to the event | | pathParameters (optional) | Any path parameters that the API Gateway would have added to the event | | stageVariables (optional) | Any query stage variables that the API Gateway would have added to the event | | resource (optional) | The resource value API gateway would have added to the event |

Context Parameters

Context parameters are only used when listenerType is handler. These help fill out the context parameter when executing the handler.

| Parameter | Description | |---------------------------------|----------------------------------------------------------------| | functionName (required) | The name of the Lambda function. | | timeout (optional) | The timeout for the Lambda function. | | awsRequestId (optional) | A requestID that is typically a UUID. | | memoryLimitInMB (optional) | The memory size for the Lambda function. | | functionVersion (optional) | The version of the Lambda function. | | logStreamName (optional) | A log stream name for CloudWatch Logs. | | invokedFunctionArn (optional) | The ARN for the function | | clientContext (optional) | Any clientContext that would be sent, matches ClientContext. | | identity (optional) | A CognitoIdentity object that would be set by Lambda. |