# @nju33/slack

> [![github](https://badgen.net/badge//nju33,slack/000?icon=github&list=1)](https://github.com/nju33/slack) [![npm:version](https://badgen.net/npm/v/@nju33/slack?icon=npm&label=)](https://www.npmjs.com/package/@nju33/slack) [![ci:status](https://badgen.net/

Latest version **1.7.5** (published 2019-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nju33/slack
pnpm add @nju33/slack
yarn add @nju33/slack
bun add @nju33/slack
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.5 |
| Published | 2019-03-12 |
| First published | 2018-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.10.0 |
| Dependencies | 2 |
| Unpacked size | 353.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | nju33 |

## Links

- npm: https://www.npmjs.com/package/@nju33/slack
- Repository: https://github.com/nju33/slack
- Homepage: https://github.com/nju33/nju33/slack
- Issues: https://github.com/nju33/nju33/slack/issues
- npm.io page: https://npm.io/package/@nju33/slack

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0
- [snakecase-keys](https://npm.io/package/snakecase-keys.md) ^2.1.0

## Recent versions

- 1.7.5 (latest) — 2019-03-12
- 1.1.0-0 (next) — 2019-02-12
- 1.7.4 — 2019-03-11
- 1.7.3 — 2019-03-11
- 1.7.2 — 2019-03-11
- 1.7.1 — 2019-03-11
- 1.7.0 — 2019-03-11
- 1.6.6 — 2019-03-03
- 1.6.4 — 2019-03-03
- 1.6.2 — 2019-03-03
- 1.6.0 — 2019-03-03
- 1.4.0 — 2019-03-01
- 1.2.0 — 2019-03-01
- 1.0.0-0 — 2018-11-26
- 0.4.3 — 2018-11-23
- … 8 more at https://npm.io/package/@nju33/slack/versions

## README

# @nju33/slack

[![github](https://badgen.net/badge//nju33,slack/000?icon=github&list=1)](https://github.com/nju33/slack)
[![npm:version](https://badgen.net/npm/v/@nju33/slack?icon=npm&label=)](https://www.npmjs.com/package/@nju33/slack)
[![ci:status](https://badgen.net/circleci/github/nju33/slack)](https://circleci.com/gh/nju33/slack)
[![document:typedoc](https://badgen.net/badge/document/typedoc/9602ff)](https://nju33--slack.netlify.com/)
[![license](https://badgen.net/npm/license/vwxy)](https://github.com/nju33/vwxy/blob/master/LICENSE)
[![code style: prettier](https://badgen.net/badge//prettier/ff69b3?label=code%20style)](https://github.com/prettier/prettier)
[![typescript](https://badgen.net/badge/lang/typescript/0376c6)](https://www.typescriptlang.org/)

## Install

```bash
yarn add @nju33/slack
```

## Usage

```ts
import {useChat} from '@nju33/slack';

const {json, updateText, useAttachment} = useChat('postMessage', 'text');
updateText(text => `update-${text}`);
const {useTitle, useButton} = useAttachment('callback_id');
useTitle('title');
useButton('button name', 'button text', 'button value');

fetch(responseURL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json; charset=utf-8'
  },
  body: JSON.stringify(json()),
});
//
// {
//   title: 'update-text',
//   attachments: [
//     {
//       callback_id: 'callback_id',
//       title: 'title',
//       actions: [
//        {
//          type: 'button',
//          name: 'button name',
//          text: 'button text',
//          value: 'button value',
//        }
//      ],
//     },
//   ]
// }
//
```

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