https://github.com/pindlebot/code-sha-256
https://github.com/pindlebot/code-sha-256
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pindlebot/code-sha-256
- Owner: pindlebot
- Created: 2018-03-28T03:14:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-29T03:37:05.000Z (over 7 years ago)
- Last Synced: 2025-02-08T11:13:02.083Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## 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
```js
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
}
})