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

html-lambda-cli

v1.0.3

Published

A simple command line interface for building HTML Lambda functions

Readme

html-λ-cli

A simple command line interface for html-lambda-runner.

While Amazon's Lambda functions aren't hard to make, making lot's of them is a time consuming task, especially if you're only making lots of single page serving functions. html-lambda-cli provides a convenient and clean interface to rapidly build and deploy new HTML generating Lambda functions using our html-lambda-runner module. With a bit of setup and a few lines of code, you'll have a Lambda up and running in no time.

To Install

npm install -g html-lambda-cli

Usage

init - Create the files needed for a new Lambda project in the current directory.

build - Build the project source and bundle it into a zip file in the dist folder.

serve - Preview the current Lambda by running a local server on :3000. Changes will be automatically built and get parameters will be passed.

deploy - Runs build and then uploads the result to Amazon.

Make a Lambda

Most of the work you'll need to do for each function is merely setup on Amazon's end. While it looks like a lot, it's not a hard procedure. This assumes you've setup your local AWS credentials, if you haven't yet, skip to the section below.

  1. Create a new folder for your project
  2. Run html-lambda init to create the needed files.
  3. Head over to the AWS console and open up Lambda.
  4. Click 'Create a Lambda function'.
  5. Click 'Skip' when asked to use a template.
  6. Give your function a name, description and leave the 'Runtime' set as Node.js (4.x).
  7. In the 'Edit code inline' area, put something simple for now. Something like console.log('hello') will do.
  8. Leave 'Handler' as is and select lambda_basic_execution as the Lambda role.
  9. Configure anything else if needed, then click 'Next' and 'Create'.
  10. Click on the 'API endpoints tab' and the 'Add API endpoint'.
  11. Select 'API Gateway' as the type and configure other properties as desired, setting 'Resource name' to /, 'Method' to GET 'Security' to Open.
  12. Head over to 'API Gateway' and pull up the API under your Lambda's name.
  13. Under 'Method Request' > 'URL Query String Parameters' add accessKey.
  14. Under 'Integration Request' add a new 'Content-Type' set to application/json. The template below only passes the accessKey. You can add other query parameters here as well. Click 'Save' when done.
{
      "accessKey ": "$input.params('accessKey')"
}
  1. Under 'Method Response' add a new item under 'Response Headers for 200' with a value of Content-Type.
  2. Under 'Integration Response' > 'Header Mappings', set Content-Type to 'text/html'
  3. Add a new 'Content-Type' under 'Body Mapping Templates' with the value text/html and a template of $input.path('$').
  4. Finally, click the 'Actions' button in the top left and select 'Deploy API'.
  5. Choose the development stage you selected earlier and click 'Deploy'.
  6. On the main services tab, select IAM and then in the left sidebar, choose 'Encryption Keys'.
  7. Create a new key and add yourself as a key administrator.
  8. Add lambda_basic_execution for IAM roles that can decrypt and encrypt with the key. Complete key creation.
  9. View the newly created key and copy the ARN.
  10. Paste the ARN into the lambdaKmsArn of aws-config.json. Fill in the other Lambda fields as well.
  11. In config.json set a secret key (used for simple authentication via GET over HTTPS).
  12. Finally, run html-lambda deploy.
  13. Visit your API endpoint with the proper accessKey attached, and your Lambda should present your page!

AWS Credentials

Create the file ~/.aws/credentials. The file should look like:

[default]
aws_access_key_id = <your key>
aws_secret_access_key = <your access key>