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 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-express-lambda

v0.1.10

Published

Automatically scaffold a project with Express & Claudia.js, ready to deploy to AWS Lambda

Downloads

23

Readme

generator-express-lambda NPM version Build Status Dependency Status

A scaffolding tool to build an Express app quickly, for Serverless deployment to AWS Lambda, using Claudia.js.

It uses Yeoman to automatically generate a project with Express & Claudia.js, ready to deploy to AWS Lambda.

Generator Output

Dependencies

First, install Yeoman and generator-express-lambda using npm (we assume you have pre-installed node.js).

You'll also need awscli. This can be installed via brew: brew install awscli

Installation

To install, you'll need to globally install this package along with yo and claudia, if you don't already have it.

npm install -g yo claudia generator-express-lambda

About the AWS Free Tier & Pricing

The AWS Free Tier includes a million invocations for your Lambda apps per month. This should get you pretty far for hobby projects and development. You can find out more here: https://aws.amazon.com/free/

You can estimate your total cost of using AWS Lambda here: https://s3.amazonaws.com/lambda-tools/pricing-calculator.html

Getting your AWS Keys

To get your access key ID and secret access key

  1. Open the IAM console.
  2. From the navigation menu, click Users.
  3. Select your IAM user name.
  4. Click User Actions, and then click Manage Access Keys.
  5. Click Create Access Key.
  • Your keys will look something like this:
    • Access key ID example: AKIAIOSFODNN7EXAMPLE
    • Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    • Click Download Credentials, and store the keys in a secure location.

Important

Your secret key will no longer be available through the AWS Management Console; you will have the only copy. Keep it confidential in order to protect your account, and never email it. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com.

Setting up your AWS Keys

Run the following from your terminal to create your default AWS configuration, if one does not exist:

aws configure

Alternatively, if you already have keys setup and wish to create keys specifically for claudia.js, run:

aws configure --profile claudia

This will create keys under the profile [claudia], and leave the rest of your keys in tact.

Creating a New Project

Make a new directory for your project, and navigate into it.

mkdir <project-name>
cd <project-name>

Then generate your new project (from inside your new project directory):

yo express-lambda

This will create a ready-to-deploy Express application you can start your project from. It includes minimal dependencies to run your project locally, and deploy using Claudia.js.

Deploying your Project

When you are ready to deploy your project, run the following:

npm run deploy

Updating your Project

After deployment, to update your project, run:

npm run update

Where are my logs?

Logs from Lambda functions will appear in your AWS CloudWatch console. You can find your logs here: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:

To make things easier, you can run the following command:

npm run logs

You may have to tweak the value in package.json if the generated command filters for the wrong name.

About Yeoman Generator

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT