slack-easy-notifier

"Easy Slack Notifier"

Usage no npm install needed!

<script type="module">
  import slackEasyNotifier from 'https://cdn.skypack.dev/slack-easy-notifier';
</script>

README

slack-easy-notifier

Easiest way to send messages to slack

How to use

  1. Install the module:
npm install slack-easy-notifier --save
  1. Only set your webhook url that you can find on Slack's incomming webhook integration and set your username.
  2. Enjoy!
//import the module to your project
var slack = require('slack-easy-notifier');
//set your webhook and username which will be displayed on the messages.
slack('https://hooks.slack.com/services/D04EXVCHY/B0AUPG81L/zF58Ido49bneWZJxmfKItRF2', 'Sebas-bot'); 
//post a message to slack
//slack('Message to post', '#slack-channel', ':icon:');
slack('Server has started', '#backend', ':bangbang:');

You'll see a message similar to this one.

alt text

You only need to set webhook and username variables once. After that, you can import the module anywhere into your app to post messages.

License

MIT