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

suyamiko-api

v1.0.2

Published

A suyamiko/suya.moe api client

Downloads

4

Readme

Suyamiko-API

A simple wrapper around the Suyamiko Bot's API

A bridge to the world of moe (and other services provided by the suya.moe API)!

npm install [email protected]

https://api.suya.moe/cdn.gif?awoo=SGs0VlhIbVBiZQ.gif

awoo

The Suyamiko API is private, thus this package is not meant to be used by people who do not have prior authorization to use it.

Easy setup

const ApiClient = require('suyamiko-api');
const token = 'API TOKEN HERE';

const client = new ApiClient(token); // To set a new token: client.set_token('new token')

client.neko().then(console.log)
const another_url = await client.neko();

Endpoints is defined as:

const endpoints = [
  'neko', 'awoo', 'bang', 'bite', 'blush',
  'cat', 'cry', 'cuddle', 'dance', 'hug',
  'kiss', 'lewd', 'lick', 'lizard', 'neko',
  'nom', 'nuzzle', 'pat', 'poke', 'pout',
  'shrug', 'slap', 'sleepy', 'tickle'
];

Any of these are methods of the client:

client.cuddle(), client.slap(), etc

All endpoints return promises that resolve to a url. As with all promises, append a .catch to catch errors if not using await.

try {
  const url = await client.pout();
} catch (err) {
  console.error(err);
}

Request handling errors (hopefully) contain three properties: error, code, and message

• error contains an Error object with a stack trace error.stack

• code contains the status code of the request

• message contains the body returned by the server. If possible, it will be a parsed JSON.

Common errors:

Error code 401, message { error: 'Invalid Authorization Received for protected endpoint' }

• Problem: The key you provided was invalid. • Solution: Contact the owner of the API on discord via Kazuko#0180

Other errors: Open an issue on github or contact me on discord at William Zhou#0001 via https://discord.gg/jj5FzF7