Skip to content

A simple node module that tells you if AWS Lambda is warm.

License

Notifications You must be signed in to change notification settings

brettneese/isLambdaWarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isLambdaWarm

A simple module that'll tell you if your lambda is warm, by checking for the existence of /tmp/isLambdaWarm, which is the most reliable way to check this kind of thing (as the /tmp/ folder is shared across invocations).

If it's not, it writes the Date.now() when this module was invoked to /tmp/isLambdaWarm. That should give you an approximate time when the Lambda container was first booted.

Usage

const lambdaWarm = require('./index');

lambdaWarm(function (err, warm, date){
    console.log(err); // any errors
    console.log(warm); // boolean
    console.log(date); // Date object with when this module was first ran in a lambda
});

About

A simple node module that tells you if AWS Lambda is warm.

Resources

License

Stars

Watchers

Forks

Packages

No packages published