@ebay/oja-tools

2.0.2 • Public • Published

oja-tools

Downloads

This module is a subset of eBay Oja framework.

The module defines generic actions that can be used to organize actions into more complex strictures.

Installation

$ npm install @ebay/oja-tools --save

Usage

Pipe action

THe pipe action allows to assemble other actions into a pipelines.

  • actions.json
{
    "PIPE-EXAMPLE/route": {
        "function": "@ebay/oja-tools/create-and-call",
        "action": "oja/pipe",
        "arguments": {
            "pipe": [
                "FOONS/foo",
                "BARNS/bar",
                "QAZNS/qaz"
            ]
        }
    }
}
  • other actions action.json:
{
    "FOONS/foo": "foo",
    "BARNS/bar": "bar",
    "QAZNS/qaz": "qaz"
}
  • bar/qaz/foo.js:
module.exports = context => async next => {
    const result = await next();
    return [...result, 'foov'];
}
  • calling action:
const { createContext } = require('@ebay/oja-action');
const context = await createContext();
const result = await context.action('PIPE-EXAMPLE/route');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    0
  • 2.0.1
    0
  • 2.0.0
    0

Package Sidebar

Install

npm i @ebay/oja-tools

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

5.1 kB

Total Files

8

Last publish

Collaborators

  • glin1111
  • alberg.gu
  • ebay-opensource
  • gchads
  • malhan
  • davidvc
  • yufwang
  • lulavalva
  • sendlo
  • ebay-owner
  • ianmcburnie
  • mlrawlings
  • dylanpiercey
  • supnate
  • tibalt
  • akleinsteiber
  • fgoris
  • scttdavs
  • agliga
  • dimichgh
  • abiyasa
  • sdepold