npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@slack/cli-hooks

v1.1.2

Published

Node implementation of the contract between the Slack CLI and Bolt for JavaScript

Downloads

153

Readme

Slack CLI Hooks

codecov

The @slack/cli-hooks package contains scripts that implement the contract between the Slack CLI and Bolt for JavaScript.

Overview

This library enables inter-process communication between the Slack CLI and applications built with Bolt for JavaScript.

When used together, the CLI delegates various tasks to the Bolt application by invoking processes ("hooks") and then making use of the responses provided by each hook's stdout.

For a complete list of available hooks, read the Supported Hooks section.

Requirements

This package supports Node v18 and higher. It's highly recommended to use the latest LTS version of Node.

An updated version of the Slack CLI is also encouraged while using this package.

Installation

Add this package as a development dependency for your project with the following command:

$ npm install --save-dev @slack/cli-hooks

Follow the installation guide to download the Slack CLI and easily run the scripts included in this package.

Usage

A Slack CLI-compatible Slack application includes a slack.json file that contains hooks specific to that project. Each hook is associated with commands that are available in the Slack CLI. By default, get-hooks retrieves all of the supported hooks and their corresponding scripts as defined in this package.

The CLI will try to use the version of the @slack/cli-hooks specified in your application's package.json. The hooks in this package are automatically added to the ./node_modules/.bin directory of your application when this package is installed.

Supported Hooks

The hooks that are currently supported for use within the Slack CLI include check-update, doctor, get-hooks, get-manifest, and start:

| Hook Name | CLI Command | File |Description | | -------------- | ---------------- | ---- | ----------- | | check-update | slack update | check-update.js | Checks the project's Slack dependencies to determine whether or not any packages need to be updated. | | doctor | slack doctor | doctor.js | Returns runtime versions and other system dependencies required by the application. | | get-hooks | All | get-hooks.js | Fetches the list of available hooks for the CLI from this repository. | | get-manifest | slack manifest | get-manifest.js | Converts a manifest.json file into a valid manifest JSON payload. | | start | slack run | start.js | While developing locally, the CLI manages a socket connection with Slack's backend and utilizes this hook for events received via this connection. |

Overriding Hooks

To customize the behavior of a hook, add the hook to your application's slack.json file and provide a corresponding script to be executed.

When commands are run, the Slack CLI will look to the project's hook definitions and use those instead of what's defined in this library, if provided. Only supported hooks will be recognized and executed by the Slack CLI.

Below is an example slack.json file that overrides the default start hook:

{
  "hooks": {
    "get-hooks": "NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-get-hooks",
    "start": "npm run dev"
  }
}

Troubleshooting

Sometimes the hook scripts are installed globally and might not be automatically updated. To determine the source of these scripts, check the node_modules/.bin directory of your project then run the following command:

$ which npx slack-cli-get-hooks # macOS / Linux
C:\> where.exe npx slack-cli-get-hooks # Windows

These hooks can be safely removed and reinstalled at your application directory to ensure you're using the correct version for your project.

Getting help

If you get stuck, we're here to help. The following are the best ways to get assistance working through your issue:

  • Issue Tracker for questions, feature requests, bug reports and general discussion related to these packages. Try searching before you create a new issue.
  • Email us: [email protected]
  • Community Slack: a Slack community for developers building all kinds of Slack apps. You can find the maintainers and users of these packages in #lang-javascript.