Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orangewise/build-lambdas
https://github.com/orangewise/build-lambdas
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/orangewise/build-lambdas
- Owner: orangewise
- Created: 2020-01-31T06:59:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-13T16:45:48.000Z (almost 5 years ago)
- Last Synced: 2024-10-04T20:15:44.852Z (about 1 month ago)
- Language: TypeScript
- Size: 96.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# build-lambdas
[![Node.js CI][ci-badge]][ci-url]
[![npm version][npm-badge]][npm-url]Utility to build your lambdas in parallel.
- runs `npm install --production` after removing `node_modules` folder
- runs `npm ci --only=production` if there is a package-lock.json
- it can zip your lambdas## Usage
As a module:
```javascript
const path = require('path')
const join = path.join
const buildLambdas = require('build-lambdas')const lambdaFolder01 = join('test', 'fixtures', 'lambdas', 'lambda-with-lock-01')
const lambdaFolder02 = join('test', 'fixtures', 'lambdas', 'lambda-with-lock-02')
const lambdaFolder03 = join('test', 'fixtures', 'lambdas', 'lambda-with-lock-03')
const lambdaFolderA = join('test', 'fixtures', 'lambdas', 'lambda-with-lock-a')async function buildAndZip() {
await buildLambdas.runParallel([
{ args: ['install', 'zip'], cwd: lambdaFolder01 },
{ args: ['install', ['run', 'build'], 'zip'], cwd: lambdaFolder02 },
// you can also run your own function:
{ args: ['install', customZip], cwd: lambdaFolder03 }
])
}// My own zip function:
async function customZip() {
return buildLambdas.zipDirectory(lambdaFolderA, 'lambda-with-custom-zip-filename.zip')
}buildAndZip()
```## License
ISC
[npm-badge]: https://badge.fury.io/js/build-lambdas.svg
[npm-url]: https://badge.fury.io/js/build-lambdas[ci-badge]: https://github.com/orangewise/build-lambdas/workflows/Node.js%20CI/badge.svg
[ci-url]: https://github.com/orangewise/build-lambdas/actions