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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hipjabber

v0.3.0

Published

A promise-based HipChat NodeJS client

Readme

A promise-based HipChat NodeJS client.

Development status: Room messaging and notifications are there but not other API. Since I don't have time I will just add more supported API as needed. PR is always welcome.

Usage

import HipJabber from 'hipjabber'

const hipJabber = new HipJabber({
  baseURL: 'https://[your-team-name].hipchat.com/v2',
  authToken: 'auth_token_here'
})

const name = 'Room-Name'

hipJabber.rooms(name).messages.create({
  message: 'test message from HipJabber'
})
.then((message) => {
  // Calling `#toJSON()` on any instance returned will always return the actual result
  // returned from the API. In this case, the response is described at
  // [https://www.hipchat.com/docs/apiv2/method/send_message]
  const messageJSON = message.toJSON()

  assert(typeof messageJSON.id === 'string')
  assert(typeof messageJSON.timestamp === 'string')
})
.catch((error) => {
  // All HTTP error is an error from `axios` [https://github.com/mzabriskie/axios] module.
  console.log('error.response:', error.response)
})

Tests

Update test/integration/config.js and run:

$ yarn test-integration   # or npm run test-integration

API

Rooms

Get all rooms

For all query parameters and response, see https://www.hipchat.com/docs/apiv2/method/get_all_rooms. Returns a promise that will be resolved to a Rooms instance.

const query = {
  // ...
}

hipJabber.rooms.list(query)
  .then(rooms => console.log(rooms.toJSON())

Create room

For all body parameters and response, see https://www.hipchat.com/docs/apiv2/method/create_room. Returns a promise that will be resolved to a Room instance.

const name = 'Room-Name'

const body = {
  name,
  privacy: 'private',
  topic: 'Room-Topic'
}

hipJabber.rooms.create(body)
  .then(room => room.messages.create({ message: '...' })) // See `Messages` API subsection below.

Get room

For all query parameters and response, see https://www.hipchat.com/docs/apiv2/method/get_room. Returns a promise that will be resolved to a Room instance.

const name = 'Room-Name'

const body = {
  name,
  privacy: 'private',
  topic: 'Room-Topic'
}

hipJabber.rooms(name).retrieve()
  .then(room => room.messages.create({ message: '...' })) // See `Messages` API subsection below.

Update room

For all body parameters and response, see https://www.hipchat.com/docs/apiv2/method/update_room. Returns a promise that will be resolved to a Room instance.

const name = 'Room-Name'

hipJabber.rooms(name).update({
  name: `${name}-Updated`,
  privacy: 'private',
  topic: 'HipJabber Topic Updated',
  is_archived: false,
  is_guest_accessible: false,
  owner: {
    id: '4943927'
  }
})
.then(room => room.messages.create({ message: '...' })) // See `Messages` API subsection below.

Delete room

For all query parameters and response, see https://www.hipchat.com/docs/apiv2/method/delete_room. Returns a promise.

const name = 'Room-Name'

hipJabber.rooms(name).destroy()
  .then(() => console.log('Room deleted'))

Messages

Get room history

For all query parameters and response, see https://www.hipchat.com/docs/apiv2/method/view_room_history. Returns a promise that will be resolved to a Messages instance.

const name = 'Room-Name'

const query = {
  // ...
}

hipJabber.rooms(name).messages.list(query)
  .then(messages => console.log(messages.toJSON())

Get recent room history

For all query parameters and response, see https://www.hipchat.com/docs/apiv2/method/view_recent_room_history. Returns a promise that will be resolved to a Messages instance.

const name = 'Room-Name'

const query = {
  // ...
}

hipJabber.rooms(name).messages.latest(query)
  .then(messages => console.log(messages.toJSON())

Send message

For all body parameters and response, see https://www.hipchat.com/docs/apiv2/method/send_message. Returns a promise that will be resolved to a Message instance.

const name = 'Room-Name'

const body = {
  message: 'Test message from HipJabber'
}

hipJabber.rooms(name).messages.create(body)
  .then(message => console.log(message.toJSON())

Notifications

Send notification

For all body parameters and response, see https://www.hipchat.com/docs/apiv2/method/send_room_notification. Returns a promise that will be resolved to a Notification instance.

const name = 'Room-Name'

const body = {
  message: 'Test notification from HipJabber, (image by Wikipedia with https://creativecommons.org/licenses/by-sa/3.0/ license)',
  notify: false,
  card: {
    id: '1',
    style: 'image',
    title: 'Test card title',
    description: 'Test notification from HipJabber, (image by Wikipedia with https://creativecommons.org/licenses/by-sa/3.0/ license)',
    url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/103px-Wikipedia-logo-v2.svg.png',
    thumbnail: {
      url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/103px-Wikipedia-logo-v2.svg.png'
    }
  }
}

hipJabber.rooms(name).notifications.create(body)
  .then(notification => console.log(notification.toJSON())

License

Copyright 2017 Saran Siriphantnon <[email protected]> MIT License.