NodeJS package.json dependency monitor for AWS Lambda functions to send email notifications when packages are out of date
npm install package-monitor-lambdaRequires 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.
npm install package-monitor-lambda --saveRequire within the application code:
`` javascript`
var pml = require('package-monitor-lambda');
javascript
var pml = require('package-monitor-lambda');var repos = [
{
owner: 'adambreznicky',
name: 'jerryshotrods',
subdirectory: ''
},
{
owner: 'TNRIS',
name: 'data-download',
subdirectory: 'application'
}
];
var recipients = ['recieverEmail@domain.com'];
var region = 'us-east-1';
var source = 'sesVerified@domain.com';
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 use 'src/app', or if it is in use 'app'`