Gathering detailed insights and metrics for @cumulus/cumulus-message-adapter-js
Gathering detailed insights and metrics for @cumulus/cumulus-message-adapter-js
Gathering detailed insights and metrics for @cumulus/cumulus-message-adapter-js
Gathering detailed insights and metrics for @cumulus/cumulus-message-adapter-js
A library for validating and parsing the Cumulus message protocol
npm install @cumulus/cumulus-message-adapter-js
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (52.74%)
TypeScript (43.98%)
Shell (3.28%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
5 Stars
293 Commits
6 Forks
15 Watchers
14 Branches
33 Contributors
Updated on Jan 27, 2025
Latest Version
2.3.0
Package Id
@cumulus/cumulus-message-adapter-js@2.3.0
Unpacked Size
50.20 kB
Size
15.12 kB
File Count
23
NPM Version
10.5.0
Node Version
20.12.2
Published on
Jan 27, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
25
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.
Read the Cumulus Documentation
The Cumulus Message Adapter is a library that adapts incoming messages in the Cumulus protocol to a format more easily consumable by Cumulus tasks, invokes the tasks, and then adapts their response back to the Cumulus message protocol to be sent to the next task.
The cumulus-message-adapter-js can be installed via Node Package Manager (NPM) and the package is located here.
The package can be added to your project by running npm install @cumulus/cumulus-message-adapter-js --save
.
In order to use the Cumulus Message Adapter, you will need to create two methods in your task module: a handler function and a business logic function.
The handler function is a standard Lambda handler function which takes three
parameters (as specified by AWS): event
, context
, and callback
.
The business logic function is where the actual work of your task occurs. It
should take two parameters: nestedEvent
and context
.
The nestedEvent
object contains two keys:
input
- the task's input, typically the payload
of the message,
produced at runtimeconfig
- the task's configuration, with any templated variables
resolvedThe context
parameter is the standard Lambda context as passed by AWS.
The return value of the business logic function will be placed in the
payload
of the resulting Cumulus message.
Expectations for input, config, and return values are all defined by the task, and should be well documented. Tasks should thoughtfully consider their inputs and return values, as breaking changes may have cascading effects on tasks throughout a workflow. Configuration changes are slightly less impactful, but must be communicated to those using the task.
The Cumulus Message adapter for Javascript provides one method:
runCumulusTask
. It takes five parameters:
taskFunction
- the function containing your business logic (as described
above)cumulusMessage
- the event passed by Lambda, and should be a Cumulus
Messagecontext
- the Lambda contextcallback
- the callback passed by Lambdaschemas
- JSON object with the locations of the task schemasThe schemas
JSON should contain input:
, output:
, and config:
with strings for each location. If the schema locations are not specified, the message adapter will look for schemas in a schemas directory at the root level for the files: input.json, output.json, or config.json. If the schema is not specified or missing, schema validation will not be performed.
1const cumulusMessageAdapter = require('@cumulus/cumulus-message-adapter-js'); 2 3function myBusinessLogic(nestedEvent, context) { 4 console.log('Hello, example!'); 5 return { answer: 42 }; 6} 7 8// The handler function should rarely, if ever, contain more than this line 9function handler(event, context, callback) { 10 cumulusMessageAdapter.runCumulusTask(myBusinessLogic, event, context, callback, schemas); 11} 12exports.handler = handler;
Tasks that use this library are just standard AWS Lambda tasks. Information on creating release packages is available here.
For documentation on how to utilize this package in a Cumulus Deployment, view the Cumulus Workflow Documenation.
There are two environment variables that can be used with this library:
CUMULUS_MESSAGE_ADAPTER_DISABLED=true
CUMULUS_MESSAGE_ADAPTER_DIR
To run the tests for this package, run npm run lint && npm test
This approach has a few major advantages:
meta
and cumulus_meta
that are owned internally and may therefore
be broken in future updates. To gain access to fields in these structures,
tasks must be passed the data explicitly in the workflow configuration.meta
. Cumulus owns cumulus_meta
. Tasks define their own config
,
input
, and output
formats.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 11/15 approved changesets -- score normalized to 7
Reason
8 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More