Randstuff API on Node.JS using Axios.
NodeJS
and Axios
library (npm i axios
)
- Put
randstuff.js
in your project folder
import { Randstuff } from './randstuff.js';
const rnd = new Randstuff();
rnd.get_random_joke().then((joke) => console.log(`Joke: ${joke["joke"]["text"]}`));
For more information about returnable objects and functions, refer to randstuff.md
.