# node-slack-upload

> A node module for uploading files to slack using multipart or string

Latest version **2.0.0** (published 2019-07-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-slack-upload
pnpm add node-slack-upload
yarn add node-slack-upload
bun add node-slack-upload
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-07-18 |
| First published | 2015-04-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Maintainers | idoesh |
| Keywords | slack, upload, file, post |

## Links

- npm: https://www.npmjs.com/package/node-slack-upload
- Repository: https://github.com/elegantmonkeys/node-slack-upload
- Issues: https://github.com/elegantmonkeys/node-slack-upload/issues
- npm.io page: https://npm.io/package/node-slack-upload

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.14
- [request](https://npm.io/package/request.md) ^2.54.0
- [underscore.string](https://npm.io/package/underscore.string.md) ^3.0.3

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-07-18
- 1.2.1 — 2016-11-07
- 1.2.0 — 2016-10-29
- 1.1.1 — 2016-05-23
- 1.1.0 — 2016-02-08
- 1.0.4 — 2016-01-07
- 1.0.3 — 2015-04-04
- 1.0.2 — 2015-04-04
- 1.0.1 — 2015-04-04
- 1.0.0 — 2015-04-04

## README

# node-slack-upload
> A node module for uploading files to slack using multipart or string

[Slack](https://slack.com/) is a messaging platform that is easy to integrate with.
This module should be useful for for uploading files to Slack!

## Install

node-slack-upload is available via npm:

```
npm install node-slack-upload
```

## Usage

Get your Slack api token from [here](https://api.slack.com/web).

```
var Slack = require('node-slack-upload');
var slack = new Slack(token);
```

To upload a file from the filesystem as a post
```
slack.uploadFile({
	file: fs.createReadStream(path.join(__dirname, '..', 'README.md')),
	filetype: 'post',
	title: 'README',
	initialComment: 'my comment',
	channels: 'XXXXX'
}, function(err, data) {
	if (err) {
		console.error(err);
	}
	else {
		console.log('Uploaded file details: ', data);
	}
});
```

To upload a file from a string as a post
```
slack.uploadFile({
	content: 'My file contents!',
	filetype: 'post',
	title: 'README',
	initialComment: 'my comment',
	channels: 'XXXXX'
}, function(err, data) {
	if (err) {
		console.error(err);
	}
	else {
		console.log('Uploaded file details: ', data);
	}
});
```
For more details please refer [https://api.slack.com/methods/files.upload](https://api.slack.com/methods/files.upload)

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