0.0.12 • Published 4 years ago

build-lambdas v0.0.12

Weekly downloads
5
License
ISC
Repository
github
Last release
4 years ago

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

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.1

4 years ago