# jenkins-slack

> Jenkins notifications for slack

Latest version **0.0.1** (published 2017-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install jenkins-slack
pnpm add jenkins-slack
yarn add jenkins-slack
bun add jenkins-slack
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-08-15 |
| First published | 2017-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonnatan Oyarzun |
| Maintainers | joyarzun |
| Keywords | jenkins, notification, slack, nodejs |

## Links

- npm: https://www.npmjs.com/package/jenkins-slack
- Repository: https://github.com/joyarzun/jenkins-slack
- Homepage: https://github.com/joyarzun/jenkins-slack#readme
- Issues: https://github.com/joyarzun/jenkins-slack/issues
- npm.io page: https://npm.io/package/jenkins-slack

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) ^6.5.0
- [axios](https://npm.io/package/axios.md) ^0.16.2
- [express](https://npm.io/package/express.md) ^4.15.4
- [body-parser](https://npm.io/package/body-parser.md) ^1.17.2

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-08-15

## README

Jenkins Slack Notificator
=========

Allow notifications to Slack from Jenkins with a simple Webhook

![Message](./slack.png "Message")

In advance: The image is just referential :p

## Installation

  `npm install jenkins-slack --save`

## Usage

    const App = require("jenkins-slack");
    const config = {
      port: 8080
      token: "xoxb-XXXXXXXXX",
      channel: "XXXXXXXXX" //channel id, not name
    };

    const app = App(config);
  
Then, go to your job, configure, and in Job Notifications like:
![Job Notifications](./job.png "Job Notifications")

The next parameters can be customized in config object:

    {
      route: "/slack-notification",
      port: 8080,
      processBody: body => ({
        name: body.name,
        url: body.build.full_url,
        status: body.build.status,
        scm: body.build.scm
      }),
      slackPostMessageUrl: "https://slack.com/api/chat.postMessage",
      textFormat: data =>
        `The job \`${data.name}\` has finished\nStatus: \`${data.status}\``
    }

## How to get token and channel

To get a token you can use your own or create an app https://api.slack.com/apps

To obtain channel id you can go to https://api.slack.com/methods/channels.list/test and get a list of channels.

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

---
_Source: https://npm.io/package/jenkins-slack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
