@nutshelllab/service-invoke

0.0.9 • Public • Published

service-invoke

About

This package is used in Nutshell's lambda-powered micro-service template. We have a rule saying it's ok for a lambda to make a direct invokation of another lambda ONLY IF there're both in the same service.

That's why this package infered the current service execution context.

Usage

Configure your serverless.yml to inject environment variable

provider:
  ...
  environment: # Service wide environment variables
    SLS_SERVICE_NAME: ${self:service.name} 
    SLS_STAGE: ${self:provider.stage} 

Invoke in your JS File

import serviceInvoke from '@nutshelllab/service-invoke'

/// ... your awesome code here
const result = await serviceInvoke('lambda-in-the-same-service', {
  // PAYLOAD
})

🚧 This repo has just be created 🚧

Readme

Keywords

none

Package Sidebar

Install

npm i @nutshelllab/service-invoke

Weekly Downloads

1

Version

0.0.9

License

GPL-3.0

Unpacked Size

356 kB

Total Files

10

Last publish

Collaborators

  • 7hanith
  • bluer4v3n
  • vblitz