Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-core-utils

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-core-utils

Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, etc.

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

aws-core-utils v2.0.0

Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, etc.

Currently includes:

  • arns.js
    • Utilities for working with Amazon Resource Names (ARNs)
  • aws-errors.js
    • Utilities for working with AWS errors.
  • lambdas.js
    • Utilities for working with AWS Lambda, which enable extraction of function names, versions and, most importantly, aliases from AWS contexts and their invoked function ARNs.
  • regions.js
    • Utilities for resolving the AWS region from various sources (primarily for AWS Lambda usage).
  • stages.js
    • Utilities for resolving or deriving the current stage (e.g. dev, qa, prod) from various sources (primarily for AWS Lambda usage).
    • Utilities for configuration of stage handling.
    • Configurable and default functions for generating stage-qualified stream and resource names.
    • Configurable and default functions for extracting stages from stage-qualified stream and resource names.
  • stream-events.js
    • Utilities for extracting information from AWS Kinesis and AWS DynamoDB stream events.

This module is exported as a Node.js module.

Installation

Using npm:

$ {sudo -H} npm i -g npm
$ npm i --save aws-core-utils

In Node.js:

// To use the ARN utilities
const arns = require('aws-core-utils/arns');

// To resolve the AWS region
const regions = require('aws-core-utils/regions');

// To derive stages from AWS events 
const stages = require('aws-core-utils/stages');

// To use the L from AWS events 
const lambdas = require('aws-core-utils/lambdas');

// To use the AWS errors utilities 
const awsErros = require('aws-core-utils/aws-errors');

Unit tests

This module's unit tests were developed with and must be run with tape. The unit tests have been tested on Node.js v4.3.2.

Install tape globally if you want to run multiple tests at once:

$ npm install tape -g

Run all unit tests with:

$ npm test

or with tape:

$ tape test/*.js

See the package source for more details.

Changes

0.9.0

  • Initial commit

1.0.0

  • Completed changes needed to release 1.0.0
  • Added unit tests for stages.js
  • Simplified regions.js API down to relevant methods
  • Fixed defects attempting to source awsRegion and eventSourceARN from event instead of Kinesis records within event.
  • Patched repository in package.json

2.0.0

  • Major changes to stages:
    • Changed existing configuration API from resolveStage-specific configuration to general stage handling configuration.
      • Added support for a custom to stage function.
      • Added support for configuration of stream and resource name qualification.
    • Added configureStage function.
    • Added configurable toStageQualifiedStreamName and default toStageSuffixedStreamName functions.
    • Added configurable extractStageFromQualifiedStreamName and default extractStageFromSuffixedStreamName functions.
    • Added configurable toStageQualifiedResourceName and default toStageSuffixedResourceName functions.
    • Added configurable extractStageFromQualifiedResourceName and default extractStageFromSuffixedResourceName functions.
    • Changed and added unit tests for revamped stages module.
  • Changes to regions:
    • Added configureRegion function.
    • Added optional, hidden failFast argument to getRegion function needed for configureRegion function.
  • Changes to aws-errors:
    • Fixed incorrect usage in comments.
    • Moved exported object's methods bodies to module-level functions.
  • Changes to lambdas:
    • Added failCallback function to fail non-API Gateway Lambda callbacks with standard app errors to facilitate mapping of errors to HTTP status codes
    • Added failCallbackForApiGateway function to fail API Gateway Lambda callbacks with standard app errors to facilitate mapping of errors to HTTP status codes
  • Added stream-events module and unit tests for it.
  • Updated core-functions dependency to version 1.2.0.
  • Added logging-utils 1.0.2 dependency.

FAQs

Package last updated on 31 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc