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

rfasqls

v2.2.3

Published

Contains handy functions and other stuff

Downloads

8

Readme

rfasqls npm version Build Status Coverage Status

This is a module made specifically for my(AqilCont)'s and his friends' use.

Installation

npm i rfasqls

Discord

This feature was made to make making bots easier. Has some helpful functions too. Usage:

const { discord } = require("rfasqls"),
      bot = new discord(client, { (Options) });

The object it returns also has its own custom event emitter. Some useful events:

  • no-command: When a message is sent and it is not a command recognized by the package.
  • dm: When the bot is "DM"ed.

Options

  • name(String)(required): Name of this bot
  • prefix(String)(required): The prefix
  • admins(Array<String>): IDs of all the administrators of the bot. Info is mainly used for the eval feature.
  • cats(Array<String>): Names of all the categories going to be included
  • cooldowns(Object): Enables cooldowns(makes a user wait for a set amount of time before using a command again) and global cooldowns. Leave empty if you want them both to work. To set one or both of them off, input this into it: { cd: false, gcd: false }
Eval

A custom eval command for anyone to use.

  • evalopt(Object): You can set the prefix and function through this. This is recommended opposed to evalprefix and/or evalfunc. Properties: prefix(String) and func(Function)
  • evalprefix(String): Sets the custom prefix of the eval command. Eg. If the value is set to r:, the usage is r: (code)
  • evalfunc(Function): Sets the function of the eval command
Messages

Messages for certain event triggers like startup, cooldowns, and global cooldowns. Default messages are used if not set to anything.

  • messages(Object): Messages for cooldowns... in an object. Properties:
    • cd: Cooldowns
    • gcd: Global cooldowns
    • ready: Bot Startup
  • cdMessage:

Functions

Some helpful functions that shorten your code. To access the functions, you need to do this:

const { functions } = require("rfasqls");
All Functions:
  1. random(min(Number), max(Number), round(Boolean)): Spawns a random number from min to max. Rounds the number if you put true for the round argument.
  2. page_maker(array(Array), num(Number), page(Number), func(Function)): You put in an array, then it executes the function including the num amount of values per "page". Specify the page number if you are not on page 1
  3. time(time(Number or String), type(string)): Converts milliseconds into a string, and the ISO format into units of time. Has other secret functionalities too.
  4. bytes(bytes(Number)): Converts a number into a unit of Bytes, MegaBytes, GigaBytes, or TerraBytes
  5. get_val(obj(Object), str(String)): IDK how to explain this but its a cool function that can get values from objects with random strings. Returns false if value not found.
  6. parseUrl(url(String)): Returns a promise that resolves with JSON from a given URL.
  7. capFirst(str(String)): Capitalizes the first letter of each word in a string.
  8. check(arr(Object or Array), type(Array or String)): This one is KINDA hard to explain and use. I would recommend ignoring it.
  9. equals(a(Anything), b(Anything), check_order(Boolean), crylic(Boolean)): Returns true or false depending if a is equal to b. Most handy when working with objects, or other complex values.

Events

This feature works a lot like the events module but is a lot simpler and has global events(events across the whole project). To access this feature, do this:

const { events } = require("rfasqls");

In essence, the whole events object is an event emitter. You can call it anywhere and the same events will be called through your project(Example: socket.io except you need to do stuff to make it works with HTML).

To create a local Event Emitter, just do:

const { events } = require("rfasqls"),
      e = new events();

This will create and return an object that only works in this file.

BTW I didn't just spam type rfasqls... it is an abbreviation for something I probably should have written down somewhere ;-;