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

fakeyouapi.js

v1.1.9

Published

A powerful library for interacting with the FakeYouAPI easily ( An updated version of FakeYou.js

Downloads

22

Readme

fakeyouapi.js is a powerful Node.js module that allows you to interact with the FakeYouAPI easily. (An updated version of FakeYou.js )

Features

Examples

Login or use your token

const FakeYou = require("fakeyou.js");
const fy = new FakeYou.Client({
  token: "anOptionalSecretToken",
  usernameOrEmail: "anOptionalCoolUsernameOrEmail",
  password: "anOptionalSuperSecretPassword",
});
await fy.start(); //required

Search TTS models

let models = fy.searchModel("mario");
models.first();

Make TTS Request

await fy.makeTTS("mario", "A cool text to speech");
//or
let model = fy.searchModel("mario").first();
if (model) {
  await model.request("A cool text to speech");
}

Make TTI Request

// You can search for weights by using the method below:
let weights = await fy.getTTIModels();
// This will return an array of all the available models, You log it and pick one like how you pick from an array.

// the format of the array is like this:
/*
[
  ...
  {
    title: Weight_Title, weight_token: Weight_Token
  }
  ...
]
*/

let response = await fy.makeTTI(weights[8], "A cool text to image prompt", LoraModel, NegativeText, seed, imageShape, sampler, CGF_Scale, SamplesNumber, BatchCount);

/* 

The current variables are optional and not:



LoraModel (string), NegativeText (string), seed (integer), imageShape (string), sampler (string), CGF_Scale (integer), SamplesNumber (integer), BatchCount (integer) .

You can obtain those values and inputs from FakeYou's website.

Inserting a wrong format of a integer value or a text, Will result in an error.

*/

//or

let response = await fy.makeTTI(weights[4], "A cool text to image prompt");


/*

An example of a response:

[
  'https://storage.googleapis.com/vocodes-public/media/0/3/4/2/m/0342m88c1vqjt24zd5qpat5gns270bdr/image_0342m88c1vqjt24zd5qpat5gns270bdr.png',
  'https://storage.googleapis.com/vocodes-public/media/y/9/t/k/j/y9tkj5nt40q3cqgaseje1h0zg46agwf8/image_y9tkj5nt40q3cqgaseje1h0zg46agwf8.png',
  'https://storage.googleapis.com/vocodes-public/media/h/c/s/1/d/hcs1d36papj6gknxdb8s80g4z35ndwdg/image_hcs1d36papj6gknxdb8s80g4z35ndwdg.png',
  'https://storage.googleapis.com/vocodes-public/media/f/d/j/y/k/fdjykhmrnyqj3jjjyxy4trp6dvde6qfy/image_fdjykhmrnyqj3jjjyxy4trp6dvde6qfy.png'
]

*/

LeaderBoard

let lb = await fy.leaderboard();
lb.getPosition(3, true);

Edit client user

await fy.user.edit({
  description: "Another **random** user in FakeYou",
  twitter: null,
  github: "a-cool-username",
  ttsVisibility: false,
});

Get all data from an entity

await fy.models.fetch("TM:7wbtjphx8h8v");
//or
await fy.fetchUser("acoolusername");
//or
let result = fy.results.cache.get("TR:tn7gq96wg6httvnq91y4y9fka76nj");
if (result) {
  await result.fetch();
}

Useful links