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

roulette-gif

v1.1.5

Published

Package that allows you to make a roulette gif image as easy as possible

Downloads

32

Readme

roulette-gif Logo

roulette-gif

This is a node.js package that allows you to make a roulette gif image as easy as possible

Installation

$ npm install roulette-gif
$ yarn add roulette-gif

Features

  • Simple & easy to use
  • You can edit everything in the wheel

Support

Join our support server for any question HL Services

Getting Started

At first you need to install the package

const { Wheel } = require('roulette-gif')
const wheel = new Wheel()

let slots = [
  {
    username: "Zaid",
    number: 1,
    image: 'Some avatar url'  // Must be png or any supported image by canvas
  },
  {
    username: "Ahmed",
    number: 2,
    image: 'Some avatar url'
  },
]

let { 
  buffer, 
  winner, 
  lastFrame 
} = await wheel.createGif({
  slots,
  stream: false, // Set it to true if you want to return stream insted of buffer
  wheelStroke: {
    color: '#fff',
    width: 5
  },
  slotStroke: {
    color: '#fff',
    width: 5
  },
  imageStroke: {
    color: '#fff',
    width: 5
  },
  winnerSlotColor: 'Gold'
})

You can use the buffer to send the roulette gif or save it and if you want to get a stream insted of buffer you can use stream: true The lastFrame variable is a buffer of the last image in the gif The winner variable returns the winner slot

Options

| Variable | Required | Default | Description | Type | | ------------- | ------------- | ------------- | ------------- | ------------- | | stream | false | false | Choice to return a buffer or stream | Boolean | | slots | true | null | The slots array of the users | Array | | wheelStroke | false | { width: 0, color: '#fff' } | The stroke object of the wheel | Object | | slotStroke | false | { width: 0, color: '#fff' } | The stroke object of the slot | Object | | imageStroke | false | { width: 0, color: '#fff' } | The stroke object of the center image | Object | | winnerSlotColor | false | Slot Color | Change the winner slot color | Color | | text | false | { color: '#fff', size: 14 } | The text options | Object | | arrow | false | Simple arrow | Use url image to change the wheel arrow | URL Image |

Examples

  • Send the wheel in discord
let { buffer, winner } wheel.createGif({ 
  slots
})

<Interaction | Channel>.send({ 
  files: [{ attachment: buffer, name: "roulette.png" }],
  content: `Congratulations ${winner.username} 🎉 you won`
})
  • Custom arrow
wheel.createGif({
  slots,
  arrow: 'https://example.com/arrow.png'
})
  • Custom wheel stroke
wheel.createGif({
  slots,
  wheelStroke: {
    color: 'red', // You can use hexCodes here
    width: 5
  }
})
  • Custom slot stroke
wheel.createGif({
  slots,
  slotStroke: {
    color: 'purple', // You can use hexCodes here
    width: 5
  }
})
  • Custom image stroke
wheel.createGif({
  slots,
  imageStroke: {
    color: 'green', // You can use hexCodes here
    width: 5
  }
})
  • Custom text
wheel.createGif({
  slots,
  text: {
    color: 'blue', // You can use hexCodes here
    size: 10
  }
})

Developer