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

package-monitor-lambda

v1.0.1

Published

NodeJS package.json dependency monitor for AWS Lambda functions to send email notifications when packages are out of date

Downloads

4

Readme

package-monitor-lambda

NodeJS package.json dependency monitor for AWS Lambda functions to send email notifications when packages are out of date

NodeJS

Built with:

  • NodeJS v8.9.2
  • NPM v5.6.0

Overview

Packaged designed to be used within AWS Lambda NodeJS6.10 Runtime functions. Identify GitHub repositories to monitor, email notification recipients, AWS region, and From (source) email as arguments. The package will identify out of date dependencies within the repo package.json file and email the list of packages with their versions. Personally, it is used within a Lambda function controlled by a fixed rate scheduled Cloudwatch rule. The package does a single inquiry with notification at the time it is being called and does not continually watch the repo, hence the scheduled Cloudwatch call of the Lambda function.

Requires use of AWS Simple Email Service (SES) for sending the emails which means you will have to configure the Lambda function with the proper role/policy permissions to fire SES and establish a verified email address for SES to utilize. Information on setting up these permissions can be found here.

Setup

Install the package in your project: npm install package-monitor-lambda --save

Require within the application code:

var pml = require('package-monitor-lambda');

Example

Use within the application:

var pml = require('package-monitor-lambda');

var repos = [
  {
    owner: 'adambreznicky',
    name: 'jerryshotrods',
    subdirectory: ''
  },
  {
    owner: 'TNRIS',
    name: 'data-download',
    subdirectory: 'application'
  }
];
var recipients = ['[email protected]'];
var region = 'us-east-1';
var source = '[email protected]';

pml.monitor(repos, recipients, region, source);

Arguments

Four required arguments: pml.monitor(repos, recipients, region, source);

  • repos - the application repositories you wish to check the dependecies of.
    • Must be an Array of Objects
    • Each Object must have the owner, name, and subdirectory keys
    • owner is the repo owner as a string. will be an individual or organization.
    • name is the repo name as a string.
    • subdirectory is the subfolder path the 'package.json' file resides in if it is not in the base of the project. If it is in the base, this should equal an empty sting (like ''). If the 'package.json' is nested, provide the path to the directory using only forward slashes between each directory step. For example, if 'package.son' is in <base>/src/app use 'src/app', or if it is in <base>/app use 'app'
  • recipients - array of email strings who will notified of the available package updates
    • Must be an Array
  • region - the AWS region where the Lambda & SES reside, such as 'us-east-1'
    • Must be a string
  • source - the AWS SES verified email address to send the notification from
    • Must be a string

Notice

This package serves a very specific use case. Would be more globally applicable if split into 2 packages:

  1. Repo package identifier to return properly formatted available updates
  2. AWS SES Emailer to feed the return from step 1