{"id":13746963,"url":"https://github.com/deecewan/console-slack","last_synced_at":"2025-04-14T19:22:07.756Z","repository":{"id":94844914,"uuid":"53720583","full_name":"deecewan/console-slack","owner":"deecewan","description":"Send messages to slack straight from your node.js application (or the browser)","archived":false,"fork":false,"pushed_at":"2016-03-13T06:32:54.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T21:34:34.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deecewan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-12T08:07:32.000Z","updated_at":"2019-08-20T04:17:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"c62d8e68-efb7-4ec9-81b5-21602c0b9054","html_url":"https://github.com/deecewan/console-slack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deecewan%2Fconsole-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deecewan%2Fconsole-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deecewan%2Fconsole-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deecewan%2Fconsole-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deecewan","download_url":"https://codeload.github.com/deecewan/console-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943415,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T06:01:08.067Z","updated_at":"2025-04-14T19:22:07.726Z","avatar_url":"https://github.com/deecewan.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# console.slack()\n\n## Overview\n\nA friend mentioned something about this, and I thought it'd be a cool idea.\nI've written a few slack-bots in bash to do various things, like watch a folder and post the contents of new files\n(great for a headless server), or let me know when a deploy was complete.\nHowever, I now spend a lot of time in node.js, so a bot to do this without setting it up in bash would be super handy.\n\nIt's a pretty basic module.  Not a great deal of functionality, but it should be customisable (with options) enough to\ndo almost anything you require.  If not, it's on [github](https://github.com/deecewan/console-slack).\n\nPlease submit any issues [here](https://github.com/deecewan/console-slack/issues).\n\n\n## Setup\n\n```\n    var slack = require('console-slack');\n    slack.options = options; // see below, or, set per-option.\n```\n\n\n## Usage\n\nThere's not a lot to this one.  This is it.\n\n```\nconsole.slack(message[, channel[, onSuccess]]);\n```\n\n- `message` is the content to be posted to Slack.\n- `channel` is the Slack channel to be posted to.  See below for defaults/options.\n- `onSuccess` is a function to be called once Slack has been successfully posted to.\n  - It provides two parameters, the response from Slack, and the request status.\n\n\n## Options\n\nThe options shown below are the defaults (other than webhook).  Webhook is the only required option,\nand can be set with `slack.webhook` if you don't want to pass in any other options.\n\n```\nslack.options = {\n    webhook : \"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\",\n    username: \"console.slack.bot\", // the username you want to log with,\n    emoji : \":nerd_face:\", // set an emoji to be the bots profile picture,\n    channel : \"#general\", \n}\n```\n\nThere are a couple of options that have extended functionality.\n\n- `slack.webhook` can be set to `'test'` to log to the console during development.  If it's not set at all,\ncalls to `console.slack` will fail.  They have nowhere to go.\n\n- `slack.channel` can be set to `true` to send to the webhook's default channel.\nThe channel can be set per-message, as well.\n\n## Example\n\n```\nvar slack = require('console-slack');\n\nslack.options = {\n    webhook  : 'test', // don't want to make a post to slack\n    emoji    : ':100:',\n    username : 'cool-slack-bot'\n}\n\nconsole.slack('Hello, World!');\nconsole.slack('Hello, Channel!', '#custom-channel');\nconsole.slack('Hello, function!', '', function(resp, status){\n    console.log('Response was: ' + resp);\n    console.log('Status was: ' + status);\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeecewan%2Fconsole-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeecewan%2Fconsole-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeecewan%2Fconsole-slack/lists"}