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

@grand_pubba/slack-client

v1.5.0-2

Published

A library for creating a full Slack client

Downloads

6

Readme

Node.js Slack Client Library

Travis-CI Build Status

Build Status

Description

This is a Slack client library for Node.js. It's intended to expose all of the functionality of Slack's Real Time Messaging API while providing some common abstractions and generally making your life easier, if you want it to.

This code has been built to support our hubot-slack adapter. Most other functionality isn't yet supported, and documentation is minimal, at best.

Installation

npm install slack-client --save

Usage

Slack = require 'slack-client'

slackToken = 'xoxb-YOUR-TOKEN-HERE' # Add a bot at https://my.slack.com/services/new/bot and copy the token here.
autoReconnect = true # Automatically reconnect after an error response from Slack.
autoMark = true # Automatically mark each message as read after it is processed.

slack = new Slack(slackToken, autoReconnect, autoMark)

slack.on 'open', ->
    console.log "Connected to #{slack.team.name} as @#{slack.self.name}"

slack.on 'message', (message) ->
    console.log message

slack.on 'error', (err) ->
    console.error "Error", err

slack.login()

A full example of how to use this module from Node.js can be found in the /examples directory.

Contribute

Here's the most direct way to get your work merged into the project.

  1. Fork the project
  2. Clone down your fork
  3. Create a feature branch
  4. Hack away and add tests, not necessarily in that order
  5. Make sure everything still passes by running tests
  6. If necessary, rebase your commits into logical chunks without errors
  7. Add yourself to package.json as a contributor
  8. Push the branch up to your fork
  9. Send a pull request for your branch

Copyright

Copyright © Slack Technologies, Inc. MIT License; see LICENSE for further details.

TODOs

  1. Better/any timeouts on initial websocket connection
  2. Better/any timeouts on API calls
  3. Document the connection options, etc
  4. Emit more events around unreads and mentions