
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
@lifeomic/blamda
Advanced tools
This package provides a simple CLI and Node API for bundling AWS Lambda services. Very quickly!
This package provides a simple CLI and Node API for bundling AWS Lambda services. Very quickly!
First, install the package.
yarn add -D @lifeomic/blamda
Now, bundle lambdas!
# Target a single file
yarn blamda --entries src/my-service.ts --outdir build-output --node 12
# Or, use a glob pattern
yarn blamda --entries "./src/lambdas/*" --outdir build-output --node 14
The output:
build-output/
my-service.zip # Upload this to AWS!
my-service/ # Or, package + upload this directory yourself.
my-service.js
If you need deeper bundling customization, use the Node API.
import { bundle } from '@lifeomic/blamda';
bundle({
entries: 'src/lambdas/*',
outdir: 'build-output',
node: 14,
esbuild: {
// Use this to override internal options passed to esbuild
},
}).catch((err) => {
console.error(err);
process.exitCode = 1;
});
When deploying a lambda as Synthetics Canary, it requires the packaged js file
saved under nodejs/node_modules within the packaged zip file. Please use the
option artifactPrefix to specify the directory structure within the packaged
zip file:
yarn blamda --entries src/my-service.ts --outdir build-output \
--artifact-prefix "nodejs/node_modules" --node 14
The output:
build-output/
my-service.zip # Upload this to Synthetics Canary!
my-service/ # Or, package + upload this directory yourself.
nodejs/
node_modules/
my-service.js
As a pattern, bundling Lambda code provides a handful of benefits, especially in an environment with "many deploys":
Can provide performance optimizations. Many modern bundlers optimize the bundled code in non-trivial ways. These optimizations can result in Lambda handlers that execute more quickly.
Can significantly reduce code artifact size. This pays off in multiple ways:
Provides an opportunity to make easy Lambda environment-specific optimizations.
aws-sdk module is "built-in" in to the Lambda environment. We can avoid
bundling it and therefore significantly reduce bundle size.Q: esbuild failed w/ error Could not resolve require("./src/build/**/*/DTraceProviderBindings"):
This happens when your app depends on dtrace-provider while building it on linux/windows w/ blamda.
To fix this, it needs to externalize this package by using a build script. For instance:
// build.js
const { bundle } = require('@lifeomic/blamda');
bundle({
entries: 'src/*Lambda.ts',
outdir: '../../deploy/terraform/build',
node: 16,
esbuild: {
minify: true,
sourcemap: 'inline',
external: ['dtrace-provider'], // exclude dtrace-provider
},
}).catch((err) => {
console.error(err);
process.exitCode = 1;
});
Or using blamda CLI:
blamda --entries=src/*Lambda.ts --external=dtrace-provider
FAQs
This package provides a simple CLI and Node API for bundling AWS Lambda services. Very quickly!
The npm package @lifeomic/blamda receives a total of 418 weekly downloads. As such, @lifeomic/blamda popularity was classified as not popular.
We found that @lifeomic/blamda demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.