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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-lambda-postinstall

v0.7.1-h

Published

Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.

Readme

node-lambda

!!! Modification of node-lambda

Which allows you to run post_install.sh script (if exists) after npm install --production and before creating a .zip file and deploying to lambda

node-lambda

Command line tool to locally run and deploy your node.js application to Amazon Lambda.

node-lambda run

Installation

npm install -g node-lambda-postinstall

Example App

The node-lambda-template example app makes it easy to get up and running.

Usage

There are 3 available commands.

node-lambda setup
node-lambda run
node-lambda deploy

Commands

setup

Initializes the event.json, .env files, and deploy.env files. event.json is where you mock your event. .env is where you place your deployment configuration. deploy.env has the same format as .env, but is used for holding any environment/config variables that you need to be deployed with your code to Lambda but you don't want in version control (e.g. DB connection info).

$ node-lambda setup --help

  Usage: run [options]

  Options:

    -h, --help                     output usage information

After running setup, it's a good idea to gitignore the generated event.json and .env files.

echo ".env\ndeploy.env\nevent.json" >> .gitignore

run

Runs your Amazon Lambda index.js file locally. Passes event.json data to the Amazon Lambda event object.

$ node-lambda run --help

  Usage: run [options]

  Options:

    -h, --help                     output usage information
    -h, --handler [index.handler]  Lambda Handler {index.handler}
    -j, --eventFile [event.json]   Event JSON File

deploy

Bundles and deploys your application up to Amazon Lambda.

$ node-lambda deploy --help

  Usage: deploy [options]

  Options:

    -h, --help                        output usage information
    -e, --environment [staging]       Choose environment {development, staging, production}
    -a, --accessKey [your_key]        AWS Access Key
    -s, --secretKey [your_secret]     AWS Secret Key
    -k, --sessionToken [your_token]   AWS Session Token
    -r, --region [us-east-1]          AWS Region(s)
    -n, --functionName [node-lambda]  Lambda FunctionName
    -h, --handler [index.handler]     Lambda Handler {index.handler}
    -c, --mode [event]                Lambda Mode
    -o, --role [your_role]            Amazon Role ARN
    -m, --memorySize [128]            Lambda Memory Size
    -t, --timeout [3]                 Lambda Timeout
    -d, --description [missing]       Lambda Description
    -u, --runtime [nodejs]            Lambda Runtime
    -v, --version [custom-version]    Lambda Version
    -f, --configFile []               Path to file holding secret environment variables (e.g. "deploy.env")`

Custom Environment Variables

AWS Lambda doesn't let you set environment variables for your function, but in many cases you will need to configure your function with secure values that you don't want to check into version control, for example a DB connection string or encryption key. Use the sample deploy.env file in combination with the --configFile flag to set values which will be prepended to your compiled Lambda function as process.env environment variables before it gets uploaded to S3.

Other AWS Lambda Tools Projects

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Running tests

npm install
npm test