1.2.8 • Published 4 years ago
factful.js v1.2.8
Factful.js
A Package which can give you Random Facts, Random Nasa Images in an easy way!
Index
- Importing Module
- Getting Random Facts
- Getting Random Nasa Image
- Typescript Example
Links
Quick Example
1. Importing Module
// Import Modules
const factful = require('factful.js')
2. Getting Facts
const facts = factful.fact()
// Getting Random Fact from Random Cateogary
console.log(facts.all)
// Getting Random Fact from a Paticular Cateogary
// Current Cateogaries: emoji, space, cat, dog, covid, computer, food
console.log(facts.emoji)
console.log(facts.space)
console.log(facts.cat)
console.log(facts.dog)
console.log(facts.covid)
console.log(facts.computer)
console.log(facts.food)
3. Getting Random Nasa Image
// Will return you the Image URL not the Image File!
console.log(factful.nasa())
4. Typescript Example
// Import package
import * as factful from 'factful.js'
// Getting Random fact
const facts = factful.fact()
// Getting Random Fact from Random Cateogary
console.log(facts.all)
// Getting Random Fact from a Paticular Cateogary
// Current Cateogaries: emoji, space, cat, dog, covid, computer, food
console.log(facts.emoji)
console.log(facts.space)
console.log(facts.cat)
console.log(facts.dog)
console.log(facts.covid)
console.log(facts.computer)
console.log(facts.food)
// Will return you the Image URL not the Image File!
console.log(factful.nasa())
© Science Spot | Decimal Development - 2020
1.2.8
4 years ago
1.2.7
4 years ago
1.2.6
4 years ago
1.2.5
4 years ago
1.1.5
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.0
4 years ago
0.1.1
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago