Installations
npm install slack-node
Releases
Unable to fetch releases
Contributors
Developer
clonn
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
6.5.0
NPM Version
2.15.10
Statistics
167 Stars
87 Commits
32 Forks
8 Watching
3 Branches
13 Contributors
Updated on 23 Oct 2021
Languages
CoffeeScript (89.79%)
JavaScript (8.8%)
Makefile (1.41%)
Total Downloads
Cumulative downloads
Total Downloads
64,599,474
Last day
1.2%
15,824
Compared to previous day
Last week
2.3%
81,627
Compared to previous week
Last month
16.7%
355,259
Compared to previous month
Last year
-45.4%
3,941,549
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
4
slack-node-sdk
Slack Node SDK, full support for Webhook and the Slack API, continuously updated.
Install
npm install slack-node
Slack Webhook usage
At first, you have to apply Slack webhook.
and copy webhook url
Webhook usage
Code example:
1var Slack = require('slack-node'); 2 3webhookUri = "__uri___"; 4 5slack = new Slack(); 6slack.setWebhook(webhookUri); 7 8slack.webhook({ 9 channel: "#general", 10 username: "webhookbot", 11 text: "This is posted to #general and comes from a bot named webhookbot." 12}, function(err, response) { 13 console.log(response); 14});
Use icon emoji, you can give a Slack defined emoji, or use image from URL.
1var Slack = require('slack-node'); 2 3webhookUri = "__uri___"; 4 5slack = new Slack(); 6slack.setWebhook(webhookUri); 7 8// slack emoji 9slack.webhook({ 10 channel: "#general", 11 username: "webhookbot", 12 icon_emoji: ":ghost:", 13 text: "test message, test message" 14}, function(err, response) { 15 console.log(response); 16}); 17 18// URL image 19slack.webhook({ 20 channel: "#general", 21 username: "webhookbot", 22 icon_emoji: "http://icons.iconarchive.com/icons/rokey/popo-emotions/128/after-boom-icon.png", 23 text: "test message, test message" 24}, function(err, response) { 25 console.log(response); 26});
Otherwise, you can check usage from example
Slack API support
First you have to apply an API from SLACK API page,
The method, please reference Slack API page
example code,
1var Slack = require('slack-node'); 2apiToken = "-- api token --"; 3 4slack = new Slack(apiToken); 5 6slack.api("users.list", function(err, response) { 7 console.log(response); 8}); 9 10slack.api('chat.postMessage', { 11 text:'hello from nodejs', 12 channel:'#general' 13}, function(err, response){ 14 console.log(response); 15});
Changelog
-
0.1.7
-
slack-node no longer crashes if Slack returns HTML instead of JSON.
-
0.1.6
-
support ES6, promise function.
-
0.1.3
-
use requestretry replace request. thanks for timjrobinson
-
update test
-
fixed emoji error
-
fixed return error crash when run time.
-
0.1.0
-
fixed test type error
-
support new slack webhook.
-
0.0.95
-
fixed webhook function and test
-
support file upload function
-
0.0.93
-
return header and status
-
0.0.92
-
merge slack emoji for webhook
-
pass request full request object
-
0.0.9
-
pass parameters bug fixed
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More