# simple-slack-notifier

> Send simple messages to Slack

Latest version **0.0.2** (published 2020-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-slack-notifier
pnpm add simple-slack-notifier
yarn add simple-slack-notifier
bun add simple-slack-notifier
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-05-05 |
| First published | 2020-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 89.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jan Lumbeck |
| Maintainers | jan_diegodev |

## Links

- npm: https://www.npmjs.com/package/simple-slack-notifier
- Repository: https://github.com/julum/simple-slack-notifier
- Issues: https://github.com/julum/simple-slack-notifier/issues
- npm.io page: https://npm.io/package/simple-slack-notifier

## Dependencies (2)

- [@slack/web-api](https://npm.io/package/@slack/web-api.md) ^5.8.1
- [@slack/events-api](https://npm.io/package/@slack/events-api.md) ^2.3.2

## Recent versions

- 0.0.2 (latest) — 2020-05-05
- 0.0.1 — 2020-05-04

## README

# Slack Notifier
[![Build Status](https://travis-ci.org/julum/simple-slack-notifier.svg?branch=master)](https://travis-ci.org/julum/simple-slack-notifier)
[![Coverage Status](https://coveralls.io/repos/github/julum/simple-slack-notifier/badge.svg?branch=master)](https://coveralls.io/github/julum/simple-slack-notifier?branch=master)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)

A Node.js Module to send Slack messages to a specific channel.

## Installation 
```sh
npm install simple-slack-notifier --save
yarn add simple-slack-notifier
```

## Usage
### Javascript
```javascript
const GitLabCISlackAPI = require('simple-slack-notifier');

const commitId = 'ba7b06204dfc05e140fe17e1c555169e0a1ffa30';
const token = '<Your Slack Application Token>';
const slack = new GitLabCISlackAPI();
slack.webClient(new WebClient(token)).gitlabOptions({
    commitId: commitId,
    projectName: '<GitLab Group>/<GitLab Project Name>',
    jobId: '123456789',
    gitRef: 'master',
    author: 'Super Developer',
}).build();
        
slack.sendDeploymentStartedMessage();
slack.sendDeploymentSuccessfulMessage();
slack.sendDeploymentFailedMessage();
```

### TypeScript
```typescript
import { GitLabCISlackAPI } from 'simple-slack-notifier';
import { WebClient } from '@slack/web-api';

const commitId = '<Commit Hash>';
const token = '<Your Slack Application Token>';
const slack = new GitLabCISlackAPI();
slack.webClient(new WebClient(token)).gitlabOptions({
    commitId: commitId,
    projectName: '<GitLab Group>/<GitLab Project Name>',
    jobId: '123456789',
    gitRef: 'master',
    author: 'Super Developer',
})
    .channel('myslackchannel').build();
        
slack.sendDeploymentStartedMessage();
slack.sendDeploymentSuccessfulMessage();
slack.sendDeploymentFailedMessage();
```

This will send three message your Slack Channel named `myslackchannel`.

## Test 
```sh
npm run test
```

## Coverage
```sh
npm run coverage
```

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