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

waxpaginator

v1.0.2

Published

Embed paginator for discord.js

Downloads

2

Readme

Install

npm i waxpaginator

Setup

const { Client } = require("discord.js");
const { setupPaginator } = require("WaxPaginator");

// ...

client.on("ready", () => {
    // ...
    // client { Client }
    // expirationTime { Number } time in milliseconds unused
    setupPaginator({client: client, expirationTime: 30000});
});

// ...

Creating paginator

const { addPaginator, Paginator } = require("WaxPaginator");

// ...

function create({message, channel}) {
    const embeds = [/* ... */];
    const pg = new Paginator(embeds);
    addPaginator(pg);

    if (typeof message !== undefined) pg.replyMessage(message); // message.reply
    else if (typeof channel !== undefined) pg.sendChannel(channel); // message.channel.send
}

Text to embed array

const { generateEmbedPagination } = require("WaxPaginator");

const embeds = generateEmbedPagination(
            `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam non urna ultrices, malesuada turpis sit amet, sollicitudin justo. Ut vel felis et metus tincidunt dapibus. Aenean sed ligula odio. Sed arcu nisi, lobortis eu nisl non, blandit venenatis lorem. Nam at erat luctus, tristique augue id, bibendum dui. Praesent tempus ultrices nisi, sit amet semper justo ullamcorper elementum. Ut ligula tellus, condimentum ut ornare vel, mollis ut ipsum. Duis varius neque vitae feugiat congue. Donec mollis vitae purus in aliquam. Ut bibendum urna quam, eu lobortis nulla condimentum non.
            Nullam consectetur massa eget risus rutrum, non bibendum massa sagittis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sem magna, lacinia eget sapien in, vehicula porta nulla. Fusce vel tellus vitae orci rutrum commodo. Aenean eget ultricies arcu. Praesent maximus eu risus id consectetur. Phasellus maximus imperdiet cursus. Duis ac justo a velit sagittis fermentum id eget nulla. Ut vitae neque vitae lorem consectetur malesuada quis aliquam neque. Donec quis odio elementum ex imperdiet aliquet.
            In pellentesque quam sed justo facilisis, eu pulvinar libero porta. Nulla ut felis vel urna laoreet faucibus. Etiam aliquam augue eu eros blandit, quis auctor nulla accumsan. Nunc egestas, nisi in congue vehicula, ligula nibh tempor enim, id bibendum odio tortor ut magna. Mauris iaculis eu quam a pharetra. Etiam bibendum tellus et justo iaculis, vel vestibulum nunc gravida. Nam ex arcu, dignissim id arcu et, pretium tristique urna. Praesent at fermentum nisi.
            Maecenas molestie, turpis in ultricies semper, neque elit cursus quam, feugiat rutrum metus eros sed enim. Sed molestie tortor nibh, sit amet suscipit massa blandit non. Vivamus pharetra sodales est, at auctor purus pharetra vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras in felis non tellus sagittis ultricies a sit amet sem. Praesent faucibus aliquet aliquet. Curabitur elit quam, facilisis vitae malesuada vel, consequat et purus. Sed vel sem nunc. Sed nec varius augue. Cras nulla arcu, accumsan eu magna a, fringilla cursus turpis. Morbi sit amet sodales ex, a suscipit mauris. In eget commodo neque. Proin sit amet rhoncus tortor. Phasellus tortor justo, sodales eget lorem eu, euismod euismod arcu. Nam condimentum mattis augue, at porta massa pretium ultricies. Maecenas ac ex velit.
            Cras efficitur ullamcorper odio, vitae tincidunt dolor lacinia vel. Sed ut molestie enim. Maecenas at gravida lacus. Nam tempor eros vitae tempus luctus. Ut pellentesque ut dolor at mattis. Duis nec urna suscipit, feugiat dui in, consectetur est. Suspendisse potenti. In vitae dolor malesuada, bibendum elit nec, facilisis metus. Pellentesque faucibus condimentum quam, sed dapibus eros rutrum in. Nam in lectus sed purus sagittis mattis vitae a est.`,
            {title: "Ceira", color: "#1ABC9C", maxlen: 2048});