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

u-wave-emoji

v1.0.1

Published

Emoji management plugin for üWave.

Downloads

11

Readme

u-wave-emoji

Generic support for emoji sets and configurable custom emoji for üWave servers.

Install

npm install --save u-wave-emoji

Usage

First create an instance of the u-wave-emoji plugin and .use() it. To enable custom emoji, also provide a local path or a custom blob-store instance. Then add the uw.emoji middleware to the Express app.

import emoji from 'u-wave-emoji';

uw.use(emoji({
  path: './custom-emoji',
  // OR
  store: require('fs-blob-store')('./custom-emoji')
}));


app.use('/assets/emoji', uw.emoji);

API

uw.use(emoji(opts={}))

Create and use the emoji plugin.

Available options are:

  • opts.path - A file path to a directory where custom emoji should be stored.
  • opts.store - A blob-store to be used to store emoji. By default, an fs store is used that saves emoji in the directory specified by opts.path.

uw.emoji.useEmojiSet(set)

Use a predefined emoji set. Multiple emoji sets can be used. If there are duplicate shortcodes, emoji that were registered first take precedence over emoji that were registered later.

import emojione from 'u-wave-emojione'

uw.emoji.useEmojiSet(emojione)

uw.emoji.addCustomEmoji(user, shortcode, stream)

In order to use custom emoji, a Blob Store must be configured.

Define a custom emoji. Custom emoji persist across server restarts.

Parameters

  • user - The user who is adding the emoji. This user must have the emoji.add role.
  • shortcode - String representing the emoji short code. May not contain whitespace.
  • stream - A stream or Buffer containing the emoji image data.

uw.emoji.deleteCustomEmoji(user, shortcode)

Delete an emoji.

Parameters

  • user - The user who is deleting the emoj. This user must have the emoji.remove role.
  • shortcode - Shortcode of the emoji to remove.

uw.emoji.getEmoji(shortcode)

Get information about an emoji.

Parameters

  • shortcode - Shortcode of the emoji.

Returns an object {set, shortcode, name, addedBy}. set identifies the emoji set the emoji is a part of, or null if the emoji is custom. addedBy identifies the user that added the emoji, and is only present for custom emoji.

uw.emoji.list()

Retrieve all emoji. Returns a Promise for an object of the shape {shortcode: "name"}.

Message: emoji:add

Whenever a custom emoji is added, an emoji:add message is published to the uwave channel.

Data

  • shortcode - Shortcode of the new emoji.
  • name - File name of the emoji.
  • addedBy - User ID of the user who added the emoji.

Message: emoji:remove

Whenever a custom emoji is removed, an emoji:remove message is published to the uwave channel.

Data

  • shortcode - Shortcode of the emoji that has been removed.
  • user - User ID of the user who removed the emoji.

License

MIT