Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@vandium/event-identifier

vandium-io3.3kBSD-3-Clause3.0.0

Event Identifier library for AWS Lambda

readme

Build Status npm version

@vandium/event-identifier

Library to identify AWS Lambda events using Node.js.

Features

  • Lightweight
  • No dependencies

Installation

Install via npm.

npm install @vandium/event-identifier --save

Getting Started

To use the library, call the identify() function which will return information about the event. Currently the type of the event is set in the object or unknown.

const identifier = require( '@vandium/event-identifier' );

// handler for s3 events
exports.handler = function( event, context, callback ) {

    if( identifier.indentify( event ).type !== 's3' ) {

        return callback( new Error( 'not s3 service!' ) );
    }

    callback( null, 'success!' );
}

For CloudWatch events, the object will contain have the type set to cloudwatch and the source set to the service that fired the event.

Feedback

We'd love to get feedback on how you're using lambda-tester and things we could add to make this tool better. Feel free to contact us at `feedback@vandium.io`

License

BSD-3-Clause

changelog

Change Log

3.0.0 (2019-02-13)

Breaking:

  • Returns an object rather than a string indicating the type of event

New:

  • Supports different cloudwatch event sources

2.0.0 (2018-10-22)

Updated:

  • Detects sqs event type
  • Requires node 8.10 or above

Internal:

  • Reworked how events are identified

1.0.0 (2017-03-31)

Initial Release