pambda-by-env

0.1.0 • Public • Published

pambda-by-env

Pambda switching by env.

Installation

npm i pambda-by-env

Usage

import { compose, createLambda } from 'pambda';
import { env } from 'pambda-by-env';
 
export const handler = createLambda(
  compose(
    env('DEBUG', next => (event, context, callback) => {
      // Do something for debugging.
    })
  )
);

env(name, truePambda, falsePambda)

  • name
    • A name of environment variable for switching.
  • truePambda
    • A pambda when an environment variable is true.
    • If this argument is an object, a pambda of the property corresponding to the environment variable is called.
  • falsePambda
    • A pambda when an environment variable is false.

Undefined, emptry string, 'no' and 'false' are evaluated as false.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i pambda-by-env

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

1.86 kB

Total Files

3

Last publish

Collaborators

  • nak2k