Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-node-runtime

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-node-runtime

Run any Node version on AWS Lambda

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
increased by3100%
Maintainers
1
Weekly downloads
 
Created
Source

Lambda Node

The module allows you to run your JavaScript code on any Node.js version in AWS Lambda.

Quick start

Installation

Add module to your AWS Lambda Node.js project:

npm install lambda-node-runtime -S

Usage

Write a module that holds AWS Lambda handler:

module.exports.handler = async (event, context) => {
    // Your code
}

Reference your handler using AWS Lambda Environment Variable

LAMBDA_NODE_HANDLER=index.handler

Set AWS Lambda Handler to expression

node_modules/lambda-node-runtime/index.handler

How it works

When you install lambda-node-runtime module it downloads Node 8 in node_modules dir. Therefore, when you create an AWS Lambda package it includes Node 8. When AWS Lambda package is deployed and invoked bundled Node 8 child process starts and executes your JS code.

Why is this possible?

It is possible to run Node version of your desire because Node binary is relatively small (around 10 MB when zipped) so there is plenty of space left for code (AWS Lambda package size restriction is 50 MB).

Also Node is fast to start so there is almost no latency after you invoke AWS Lambda function and when it actually starts running the code.

Keywords

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc