New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-notify-after-command

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-notify-after-command

Simple serverless plugin to send a notification to the linux system notification handler after any command serverless command (successfull or failed)

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

serverless-notify-after-command

This is a simple plugin for Serverless Framework to send a notification to the linux system notification system after any serverless command (successfull or failed).

This plugin depends that your operational system is able to run the bash commands:

sleep 
notify-send
paplay

For the plugin to work, it creates a child process the checks the amount of processes from serverless running in the system.

Install

$ npm install serverless-notify-after-command --save-dev

Add the plugin to your serverless.yml file:

plugins:
  - serverless-notify-after-command

Configure

The configuration of the plugin is done by defining a custom: notifyAfterCommand object in your serverless.yml with your specific configuration.

AttributeTypeDefaultDescription
activeBooleantrueShould run or not by default
blacklistArray[]Blacklist commands, even when active is true
whitelistArray[]Whitelist commands, even when active is false
stagesArray['development']The list of stages to run
soundBooleantrueTrue if a sound should be played too

For the stages, important to note how the plugin infers the stage. It gets the --stage option, then serverless.yml custom.stage, then serverless.yml provider.stage then 'development.' The first one it finds, is the value it considers.

custom:
  notifyAfterCommand:
    active: true
    blacklist: []
    whitelist: []
    stages: ['development']
    sound: true

Besides the serverless.yml configuration, you can pass Environment Variables to force it to use or not. Just set the SLS_NOTIFY to true or false, if you want notifications or not.

If you want to force the sound to play event when sound is false, pass the SLS_NOTIFY_SOUND=true.

SLS_NOTIFY=true serverless [command]
SLS_NOTIFY=true sls [command]
SLS_NOTIFY_SOUND=true sls [command]

Roadmap

Customize the notification sound.

Keywords

FAQs

Package last updated on 07 Apr 2020

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