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

@tmuniversal/weeb-wrapper

v0.3.4

Published

API wrapper for weeb-services

Readme

Weeb Wrapper

Weeb Wrapper is a simple API wrapper for the weeb api, an api that helps discord bot's and their developers. This is a closed API, details on weeb.sh and docs.weeb.sh.

If you want to host your own instance of this api, have a look at weeb-services.

Getting Started

Installation

With npm: npm install --save @tmuniversal/weeb-wrapper

With yarn: yarn add @tmuniversal/weeb-wrapper

Usage

const WeebWrapper = require('@tmuniversal/weeb-wrapper')

const wrapper = new WeebWrapper('<Your API key>') // Create a new instance of the API wrapper

// If you need to change the base url of the api:
const wrapper = new WeebWrapper('<You API key>', 'https://api.example.com')

wrapper.accounts // accessing the accounts api
  .validate('<Your API key>') // Doing something with it, in this case validating your API key
  .then(...) // Returns a promise, so you can work with the results
  .catch(e => { // Catch promise rejections
    console.error(e)
  })

Examples

Using the settings API

Requires API key.

Saving settings of a discord bot: in this example we are creating a setting of the type guilds named <some id>. It contains the guilds command prefix.

const WeebWrapper = require('@tmuniversal/weeb-wrapper')

const wrapper = new WeebWrapper('<Your API key>', 'https://api.example.com') // Create a new instance of the API wrapper

wrapper.settings.createSetting('guilds', '<some id>', {
  prefix: '?'
})

It's easy to retrieve the setting:

// With async/await
const result = await wrapper.settings.getSetting('guilds', '<some id>')
console.log(result) // Will return the settings: { prefix: '?' }

// With promises
wrapper.settings.getSetting('guilds', '<some id>').then(result => {
  console.log(result) // Will return the settings: { prefix: '?' }
})

Note: Subsettings are not connected to their parent settings, they perform as a full settings themselves and will work even if the parent route doesn't exist. Deleting a parent will not delete it's subsettings.

Using the BotStat API

Requires API key for post requests. Get endpoints are public.

The BotStat API serves as a means of saving certain numbers like the amount of servers a bot is in to be made publicly available.

// Updating the amount of guilds, channels, users your bot is in:
wrapper.statistics.updateBot('<id here>', 123, 456, 789)
wrapper.statistics.updateBot('<id here>', [123, 456, 789]) // or as an array
wrapper.statistics.updateBot('<id here>', {
  guilds: 123,
  channels: 456,
  users: 789
}) // or as an object

// retrieving this data:
const bot = await wrapper.statistics.getBot('<id here>')
console.log(bot)
/* example output:
{
  userId: '12345678901234545', // a discord user id
  guilds: 42,
  channels: 69,
  users: 420,
  lastUpdated: '2020-07-26T14:37:37.017Z',
  owner: {
    id: '123456781543243534',
    username: 'A name',
    discriminator: '0001'
  }
}
*/

Using TM's General API

This is a very random collection of some features I wanted to realize. An API key is NOT required for these features.

const WeebWrapper = require('@tmuniversal/weeb-wrapper')

const wrapper = new WeebWrapper(
  "<Your API key (or not since you don't need one for this)>"
)

const neko = await wrapper.general.getNeko() // Will retrieve a catgirl image url.

console.log(neko)
// (example) => https://nekos.moe/image/rygkhkosf

Upcoming

License

Please refer to the LICENSE file.