petsim.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

What Is petsim.js?

It is a JavaScript/TypeScript API wrapper for the pet simulator web API.

How Do I Install it?

Run "npm install petsim.js"

Usage

Getting Details Of A Clan

import { clan } from "petsim.js"; // Or Using The require() function

(async () => {
  const clans = await clan("HIPM"); // Get details of the "HIPM" clan
  console.log(clans); // Log out the result
})();

Hooks/Events

import { onExistChange } from "petsim.js"; // Or Using The require() function

onExistChange((after, before) => {
  // Listen for exist changes
  if (after.exist < 100) console.log(after, before); // When exist changes of a pet, check if exist is less then 100, if so, log it
});

Other

⚠️ DO NOT USE. WAITING ON API ACCESS

import { getActiveHuges } from "petsim.js"; // Or Using The require() function

(async () => {
  const activeHuges = await getActiveHuges(); // Fetch active huges
  console.log(activeHuges); // Example: [ 'Huge Koi Fish', 'Huge Bee', 'Huge Bearserker' ]
})();

Readme

Keywords

none

Package Sidebar

Install

npm i petsim.js

Weekly Downloads

0

Version

1.0.9

License

ISC

Unpacked Size

192 kB

Total Files

297

Last publish

Collaborators

  • soap_0020