@cumulus-test/common
Common utilities used across tasks
Last updated 2 years ago by kkelly51 .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @cumulus-test/common 
SYNC missed versions from official npm registry.

@cumulus/common

Common libraries for interacting with Cumulus ingest

Tasks

Cumulus tasks written in node.js should extend Task to benefit from the protocol parsing and message interpretation it provides. A minimal task class is as follows:


const Task = require('@cumulus/common/task');

module.exports = class MyTask extends Task {
  run() {
    // Read inputs
    // this.config contains task configuration with all variables resolved
    // this.message contains the incoming message, with this.message.payload
    // being the input from the previous step

    // Do actual work

    // Return output, which is the incoming message with its payload overwritten
    // to contain the output of this task. The result may optionally be a promise.
    return Object.assign({}, this.message, { payload: someOutput });
  }


  /**
   * Entrypoint for Lambda
   */
  static handler(...args) {
    return MyTask.handle(...args);
  }
}

Several modules provide support for working with Tasks and the message protocol:

General Utilities

Current Tags

  • 1.1.0-alpha.c0ebdcd8                                ...           canary (2 years ago)
  • 1.0.2-beta.0                                ...           latest (2 years ago)

7 Versions

  • 1.1.0-alpha.c0ebdcd8                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2-beta.8a155f42                                ...           2 years ago
  • 1.0.2-beta.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 10
Last Day 0
Last Week 9
Last Month 23
Dependencies (33)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |