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

@irvingjs/aws-lambda

v6.16.0

Published

Run Irving on AWS Lambda

Downloads

158

Readme

AWS Lambda Integration

This package can be used to facilitate the integration of Irving to AWS Lambda.

The @irvingjs/aws-lambda package makes use of the serverless-http package to better integrate to AWS Lambda. We also recommend using the serverless package to deploy to AWS. You can also integrate the deployment to AWS in your CI (process), if desired.

Installation

  1. npm install -g serverless and set it up to connect to AWS properly
  2. You should have the serverless or sls commands available and properly authenticated locally.

Project setup

  1. npm install @irvingjs/aws-lambda
  2. In the root of your Irving project, create an index.js (this file should have the same as the one in your package.json main key) file with the following content:
// index.js

module.exports.irving = require('@irvingjs/core/server');

The irving name exported will be the entry point for your AWS Lambda function to run your Irving site.

  1. You also need to add the aws-lambda to the list of packages in irving.config.server.js. There is no need to add it to the irving.config.js since this is a server configuration:
// irving.config.server.js

const lambdaConfig = require('@irvingjs/aws-lambda');

const config = {
  name: 'irving-dev-app',
  packages: [
    lambdaConfig,
  ],
};

module.exports = config;
  1. In the root of Irving project, create a serverless.yml file with the following content (you can update as needed):
service: irving

provider:
  name: aws
  runtime: nodejs12.x
  region: sa-east-1
  memorySize: 512

functions:
  app:
    handler: index.irving # The same as your index.js exported key.
    events:
      - http:
          path: /
          method: GET
      - http:
          path: /{any+}
          method: GET
  1. When you are ready to deploy your app, npm install --production to remove development dependencies (serverless does this for you but it is a good practice)
  2. And run npm run build to build the app files
  3. Finally, run sls deploy or serverless deploy

Be aware of the 50MB limit for direct upload/deployment from AWS.

Checking AWS Lambda support locally

To test AWS Lambda support locally, we recommend installing the serverless-offline package.Here are the steps if you need to use this package:

  1. Set up your project for AWS Lambda integration.
  2. npm install serverless-offline
  3. Add the serverless-offline plugin to the list:
service: irving

plugins:
  - serverless-offline

...
  1. Finally, run serverless offline or sls offline.

About Large Apps/Sites (Bundle Size)

If you have a really large site/app, your bundle size will probably surpass the AWS Lambda upload limit of 50MB. We are testing with the serverless-webpack to find ways to optimize the bundle as much as possible for size.

More docs about it soon. :)