JSPM

serverless-offline-variables

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 562
  • Score
    100M100P100Q106958F
  • License MIT

Mock serverless variables in offline or localstack mode

Package Exports

  • serverless-offline-variables

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serverless-offline-variables) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

serverless-offline-variables

About

serverless-offline-variables is a lightweight plugin to replace ${cf:}, ${s3:}, ${ssm:} and ${env:} parameters during the local (offline) runs, which can be very useful when testing microservices in isolation.

Installation

Use yarn or npm to add the plugin to your package dependecies:

npm install --save-dev serverless-offline-variables

or

yarn add serverless-offline-variables --dev

Usage

  1. Add plugin to you serverless plugins
plugins:
  ...
  - serverless-offline-variables
  1. Configure plugin (optional)
custom:
  ...
  offline-variables:
    stages:
      - local  # Default
    file: .env # Default
    variables: # Optional
      - ssm:hello-world: my value

By default plugin will first try to locate your variable in .env file (or in the file you specified), and only then under the variables section.

If serverless-offline-variables fails to locate a variable it falls back to original resolver.

Contributions

You are welcome to create pull requests to improve the project. Please check out the contribution quick guide to get started.

License

The project is distributed under MIT license.