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 🙏

© 2025 – Pkg Stats / Ryan Hefner

random-bonusly

v0.5.0

Published

Random bonus generator to be used with bonus.ly

Readme

random-bonusly

Random bonus generator to be used with bonus.ly

General information

If your company uses bonus.ly, you might end up noticing that you always give bonuses just to the people around you as you don't have any clue about other team's achievements, so to be fair and give away rewards to those in the far corner of the office, you can generate them randomly. This is a command line utility, once installed, just type

$ random-bonusly

and you'll create a +1 bonus to a random person, with a random quote from Star Trek (default) and the hashtag #why-so-serious.

It can also be used as a module to be imported in your project.

Getting started

This application is dependent on Node 6.x and an old application known as fortune(s) (only if you want to generate random messages). To install node you can use

$ brew install node

if you are running Mac OS X and use Homebrew as a package manager (recommended). If not, you can download an install from nodejs.org.

If you are using Linux, there are several ways of installing it. In an Ubuntu distro,

$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs

To install fortune in Mac OS X with Homebrew, do

$ brew install fortune

In a linux deb based distro,

$ sudo apt-get fortunes

After installing those, clone this repo into a local folder. You need to create a file in the same folder named secrets.json, with this format:

{
    "access_token": "youraccesstokenhere"
}

Rename the file secrets.sample.json to secrets.json and edit it to change "youraccesstokenhere" to your bonus.ly access_token, that, after logging in, you can get from here. Alternatively you can run

npm run install

which will prompt you for the api key and create the secrets.json file for you.

Then from within the cloned folder, run

$ npm install -g . 

You might have to run that as sudo if you are using Linux, depending on your distro. Now you are set to go! Just type

$ random-bonusly

and you'll see the bonus given and how many points left you have to reward others.

Command line options

  • -# : hashtag to be used.
  • --dry-run: generate a bonus and log it without posting.
  • -a: add to bonuses given by other people in the previous day.
  • -h: show list of params allowed.
  • -m : message to be used. Use quotes is the message includes spaces.
  • -p : number of points to be given.
  • -u : username of the receiver of the reward.

Used as a module in another project

If you use this inside another project, you can call the exported reward functions with an options hash, being the options (see above for an explanation):

  • hashtag:
  • dry-run:
  • add:
  • message:
  • points:
  • user:
  • set:

The help otion is ignored.

Using different fortune sets

After the last command line option, just add whatever sets you want, separated by spaces, for example:

$ random-bonusly --dry-run science pets

To see available sets of quotes,

$ fortune -f