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

@firestone-hs/aws-lambda-utils

v1.1.1

Published

npm run publish-version

Readme

AWS Lambda Utils

npm run publish-version

rm -rf dist && tsc && rm -rf dist/node_modules && 'cp' -rf dist/ /e/Source/zerotoheroes/public-lambdas/cron-build-bgs-hero-stats/node_modules/@firestone-hs/aws-lambda-utils

S3 Cost Monitoring

This repository now includes tools to monitor S3 costs by Lambda function origin. This helps you identify which Lambda functions are driving your S3 request costs.

Quick Start

  1. Test Your Environment (Recommended first step):

    ./test-aws-cli-paths.sh
  2. Simple Setup (Recommended if encountering IAM issues):

    ./setup-s3-monitoring-simple.sh

    Skips CloudWatch integration to avoid IAM role complexity

  3. Full Automated Setup (with CloudWatch integration):

    ./setup-s3-monitoring.sh
  4. If you encounter issues (Windows Git Bash path problems):

    # Clean up existing resources and start fresh
    ./setup-s3-monitoring.sh --cleanup
  5. Manual Setup (Windows PowerShell): Follow the guide in MANUAL_SETUP_WINDOWS.md

What Gets Set Up

  • CloudTrail with S3 data events for your buckets (xml.firestoneapp.com, static.zerotoheroes.com)
  • CloudWatch Log Group for CloudTrail integration
  • IAM Roles for CloudTrail → CloudWatch permissions
  • Sample CloudWatch Insights queries to analyze S3 usage by Lambda function

After Setup (15-30 minutes later)

Navigate to CloudWatch → Insights and run queries like:

fields @timestamp, userIdentity.invokedBy, eventName, resources.0.ARN
| filter eventName like /GetObject/
| filter userIdentity.type = "AssumedRole"
| filter userIdentity.invokedBy like /lambda/
| stats count() as request_count by userIdentity.invokedBy
| sort request_count desc

Expected Results

userIdentity.invokedBy                           | request_count
lambda.amazonaws.com:my-data-processor-function  | 15,247
lambda.amazonaws.com:my-backup-function          | 8,932
lambda.amazonaws.com:my-analytics-function       | 3,421

Files

  • setup-s3-monitoring-simple.sh - Simple setup (no CloudWatch integration)
  • setup-s3-monitoring.sh - Full automated setup script
  • test-aws-cli-paths.sh - Environment compatibility test
  • event-selectors.json - S3 buckets to monitor
  • s3-monitoring-queries.md - Comprehensive monitoring guide
  • MANUAL_SETUP_WINDOWS.md - Windows PowerShell setup guide

Cost Impact

  • Setup time: ~10 minutes
  • Monthly cost: ~$2-5 (depends on request volume)
  • Data availability: 15-30 minutes after setup

Troubleshooting

  • Trail already exists: Use ./setup-s3-monitoring.sh --cleanup
  • IAM role errors: Use the simple version ./setup-s3-monitoring-simple.sh
  • Windows path issues: Use MANUAL_SETUP_WINDOWS.md guide
  • No data showing: Wait 30 minutes for CloudTrail to populate

Help

./setup-s3-monitoring.sh --help

Original Package Info

This package provides utility classes for AWS Lambda functions including S3, RDS, SNS, SQS, and logging services.