💣 mass delete files from Slack using JavaScript.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
CHANGELOG.md
README.md
cli-options.js
index.js
package-lock.json
package.json
test.js

README.md

slack-delete-files npm version Build Status

Mass delete files from Slack using JavaScript.

Because Slack comes with limited file storage and there's no way to bulk delete files in order to free up space. (Source)

Install

⚠️ This app depends on Node.js 8+.

$ npm install -g slack-delete-files

Instead of polluting global installs, you can also run the Node binary directly:

$ npx slack-delete-files

Usage

$ slack-delete-files

Options:
  --help       Show help                                               [boolean]
  --version    Show version number                                     [boolean]
  --token, -t  Slack token                                   [string] [required]
  --pinned     Include pinned files                   [boolean] [default: false]
  --max        Amount of files to fetch                 [number] [default: 1000]
  --age        Delete only files older than the specified number of days
                                                          [number] [default: 30]

A Slack API token (--token) is required! Grab yours in Slack API docs.

Example

Below, we are deleting files older than 60 days, including pinned files.

slack-delete-files --age=60 --pinned --token=xoxp-34874354-4059649056
Limitations
  • Does NOT delete files sent in people's private channels.

License

MIT