Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Gives basic information on how to read the classes and stuff.
Throughout the whole SomeRandomCat
documentation or in the support server, you may see notation very often. To help you understand those, we will be going over a few common types of them.
Always keep in mind that notation is not always rigorous. There will be typos, misunderstandings, or context that will cause notation to differ from the usual meanings.
Some common notations are used to refer to a class or the properties, methods, or events of a class. There are many variations on these notations, and they are very flexible depending on the person, so use your best judgement when reading them. For example, if you are given a text <Random>
, it means an instance of the class Random. It is telling you to replace it with your own instance that you have made, but in our case, it is STATIC
which means there is no hustle and bustle of instantiating it.
The notation Class#foo
refers to a property called foo in the class Class
. However in the case of STATIC
properties you write it as Class.foo
To write an event, you can write it as <Class>#<property>:<event>
Remember that this notation is not valid JavaScript, it is a shorthand to refer to a certain piece of code.
This is the official documentation for some-random-cat. Docs version (v2.0)
To install the package, you would have to make sure that node.js is installed on your machine. After that, you can simply do npm i some-random-cat
in the terminal where you want to install the package or npm i some-random-cat -g
to install it globally.
I saw that there were not many good packages for generating random stuff. So I decided to make one. A very suitable API to generate random images of cats, dogs and random jokes, facts... A lot more!
Object-oriented
Speedy and efficient
Feature-rich
Easy
Beginner-Friendly
Flexible
Generate a random cat image:
200 weekly downloads
and... growing!
The class for generating random things such as cat images, dog images, jokes and much more!
Please make sure you do not instantiate this class. You can access it though const something = require('some-random-cat').Random
.getAdvice()
STATIC
Random method to generate an advice.
Returns: Promise<Pending>
``
.getCat()
STATIC
Random method to generate a random cat image.
Returns: Promise<Pending>
.getDog()
STATIC
Random method to generate a random dog image.
Returns: Promise<Pending>
.getFact()
STATIC
Random method to generate a random fact.
Returns: Promise<Pending>
``
.getJoke()
STATIC
Random method to generate a random joke.
Returns: Promise<Pending>
.getMeme(sub)
STATIC
Random method to generate a meme.
Returns: Promise<Pending>
``
.getString(number)
STATIC
Returns: Promise<Pending>
``
.getTopic()
STATIC
Random method to generate a topic.
Returns:Promise<Pending>
``
The class for getting information on the package or testing it.
Please make sure you do not instantiate this class. You can access it though const something = require('some-random-cat').Random
.info
STATIC
The general information for the package.
Type: ?Object
.test()
STATIC
Random method to generate an advice.
Returns: Promise<Pending>
``
Type
Description
any
The string with the advice.
Type
Description
any
URL for the image.
Type
Description
any
URL for the image.
Type
Description
any
The string for the fact.
Type
Description
any
An object with the title, description and URL
Parameters
Type
Optional
Description
sub
String
❌
The subreddit to get the meme from.
Parameters
Type
Optional
Description
number
Number
❌
The length of the string.
Type
Description
any
The string with the topic.
PARAMETER
TYPE
DESCRIPTION
author
String
The author(s) of the package.
description
String
The description of the package.
repo
Object
Current repository(s) of the package.
version
String
The version of the package.
Type
Description
any
Tests the package and retrieves an error(if any).