build-lambdas
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

build-lambdas

Node.js CI npm version

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:

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

Readme

Keywords

Package Sidebar

Install

npm i build-lambdas

Weekly Downloads

1

Version

0.0.12

License

ISC

Unpacked Size

43.6 kB

Total Files

38

Last publish

Collaborators

  • robodo