This library gives back a random fox picture link or a custom message/link when you like it. It's coded in Typescript and can be used in Javascript and Typescript.
Go to file
Minecodes 789dea92aa
Merge pull request #7 from Minecodes/snyk-upgrade-bc15aeb2844c387c3a9dc06ee91c976c
[Snyk] Upgrade typescript from 4.5.4 to 4.5.5
2022-02-12 11:36:33 +01:00
assets randomfox image added 2021-07-23 21:40:10 +02:00
node_modules randomfox image added 2021-07-23 21:40:10 +02:00
src randomfox image added 2021-07-23 21:40:10 +02:00
tests Front-End Enhancement 2021-10-28 09:56:29 +05:30
README.md image license added 2021-07-23 21:50:19 +02:00
contributors.md Create contributors.md 2021-10-28 19:09:38 +02:00
package-lock.json fix: upgrade typescript from 4.5.4 to 4.5.5 2022-02-11 04:30:37 +00:00
package.json fix: upgrade typescript from 4.5.4 to 4.5.5 2022-02-11 04:30:37 +00:00
tsconfig.json Version 1.0.3 2021-02-09 07:46:35 +01:00

README.md

randomfox

This is an library to get an link to an random fox image.
This is a API and now in TypeScript too. 👍😉 CodeFactor

The cli version: https://www.npmjs.com/package/foxes
How to work with Typescript: https://www.typescriptlang.org/docs
It work in the browser too.

Installation

Browser:

<script src="https://unpkg.com/randomfox/src/browser.js">
console.log(fox());
console.log(customfox(["Floof 1", "Floof 2", "Floof 3", "Floof 4"]));
</script>

Browser Minified:

<script src="https://unpkg.com/randomfox/src/browser.min.js">
console.log(fox());
console.log(customfox(["Floof 1", "Floof 2", "Floof 3", "Floof 4"]));
</script>

Console/Etc:

npm i randomfox

or

yarn install randomfox

or

npm i git+https://gitlab.com/Minecodes13/randomfox.git

or

yarn install git+https://gitlab.com/Minecodes13/randomfox.git

or

npm i git+https://github.com/Minecodes/randomfox.git

or

yarn install git+https://github.com/Minecodes/randomfox.git

Docs 🧐🤓

Javascript

Example

const randomfox = require("randomfox");

console.log(fox());

Random fox Image

const { fox } = require("randomfox");

console.log(fox());

Custom fox Images

const { customfox } = require("../src/main");

console.log(customfox([
	"https://randomfox.ca/images/1.jpg",
	"https://randomfox.ca/images/2.jpg",
	"https://randomfox.ca/images/3.jpg"]));

Typescript

Example

import randomfox from "randomfox";

console.log(randomfox.fox());

Random fox image

import { fox } from "randomfox";

console.log(fox());

Custom fox Images

import { customfox } from "randomfox";

console.log(customfox([
	"https://randomfox.ca/images/1.jpg",
	"https://randomfox.ca/images/2.jpg",
	"https://randomfox.ca/images/3.jpg"]));

Licenses