0.2.1 • Published 7 years ago

lc-lambda-utils v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

lc-lambda-utils

Shared Utilities for Lightning CI Lambda Functions

Prerequisites

  • Node.js 8.x

Installation

  1. npm install lc-lambda-utils or yarn add lc-lambda-utils

Usage

import { fetch, handleFetchError, FetchError } from 'lc-lambda-utils';

// Warning: env variables SUMO_URL and SLACK_URL must be present before using fetch responses

const fetchSomething = async () => {
  const fetchResults = await fetch('foo' { method: 'POST' })
    .then((res) => {
      if (someCondition) {
        throw new FetchError('an error for developers', 500, 'an error for the end user');
      }
      // Do something additional with the response if you want
      return res;
    })
    .catch((err) => handleFetchError(err));
};

Development

  1. yarn install
  2. yarn run build
0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago