slack-node is a Node.js library for interacting with the Slack API, supporting both incoming webhooks and the comprehensive Slack Web API. Currently at version 0.3.2, it maintains a policy of zero runtime dependencies, making it a lightweight choice for integrating Slack functionalities into Node.js applications. The library is designed for flexibility, offering both traditional callback-based asynchronous operations and modern Promise-based and async/await syntax, catering to various coding styles. While its version number suggests a pre-1.0 stability, the project claims continuous updates and full feature support. Its core differentiation lies in its minimalist approach to dependencies and its dual API consumption models.
npm install slack-nodeVerified import paths — ran on the pinned version, not inferred.
Demonstrates sending a message via an Incoming Webhook and calling a Slack Web API method (users.list and chat.postMessage) using `async/await` syntax, utilizing environment variables for credentials.
Always use `const Slack = require('slack-node');` to import the library. If using TypeScript, ensure your `tsconfig.json` has `"module": "commonjs"` or configure your bundler/runtime to handle CJS imports from ESM.Monitor the GitHub repository's commit history and changelog for any updates before upgrading to newer versions. Thoroughly test your integration after any update.
Ensure `slack.setWebhook('your_webhook_url')` is executed and that 'your_webhook_url' is a properly formatted and valid Slack Incoming Webhook URL.Change `import Slack from 'slack-node';` to `const Slack = require('slack-node');`.Initialize the `Slack` instance and call `slack.setWebhook('YOUR_SLACK_WEBHOOK_URL')` with a valid URL before sending messages.Verify that the API token is correct, active, and has the required scopes for the API methods you are attempting to call (e.g., `users:read` for `users.list`, `chat:write` for `chat.postMessage`).
No dependency data recorded yet.