0.0.2 • Published 5 years ago

code-sha-256 v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

code-sha-256

Compare local to remote sha-256 (for use with AWS Lambda). The use-case it to determine if you should update a function because the function's code has changed.

Example

const compareFunctionCode = require('code-sha-256')
const config = { region: 'us-east-1' }
const params = { 
  FunctionName: 'kitApiLambdaEdge',
  Qualifier: '1' // optional, default is $LATEST
}

compareFunctionCode('index.js', { params, config }).then(shouldUpdate => {
  if (shouldUpdate) {
    // update function code
  } else {
    // proceed
  }
})