npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-notify-after-command

v1.1.5

Published

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

Downloads

14

Readme

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.

| Attribute | Type | Default | Description | |:--------- |:------- |:--------------- |:--------------------------------------------- | | active | Boolean | true | Should run or not by default | | blacklist | Array | [] | Blacklist commands, even when active is true | | whitelist | Array | [] | Whitelist commands, even when active is false | | stages | Array | ['development'] | The list of stages to run | | sound | Boolean | true | True 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.