Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dads_jokes

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dads_jokes - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

assets/links.js

10

CHANGELOG.md
# Changelog
## Version 2.0.0 (Major Updates) - [25-03-2024]
-Features Added:
--Implemented icanhazdadjoke function to retrieve jokes from the icanhazdadjoke API.
Users can now access jokes from the icanhazdadjoke API using the icanhazdadjoke function.
-Changes:
--Removed all previous code implementations.
--Replaced previous functionalities with the icanhazdadjoke function to streamline joke retrieval.
## Version 1.0.1 (pkg fix) - [25-03-2024]

@@ -4,0 +14,0 @@ - Changed Github Repository

45

index.js

@@ -1,17 +0,34 @@

var mrng= require('mrng');
var mrng = require("mrng");
var links = require("./assets/links");
async function random_facts(){
var random = mrng(1,1000)
var komedy = ""
await fetch('https://api.chucknorris.io/jokes/random')
.then(response => response.json())
.then(data => {
komedy = data.value;
// console.log(chuckNorrisJoke);
})
.catch(error => komedy="Error");
const dads_jokes = {
return `${random}=> ${komedy}`
}
// 1
async icanhazdadjoke() {
try {
const response = await fetch(links.icanhazdadjoke, {
headers: {
Accept: "application/json",
},
});
module.exports = random_facts;
if (!response.ok) {
if (response.status === 404) {
throw new Error("Joke not found");
} else {
throw new Error("Network error");
}
}
const data = await response.json();
return data.joke;
} catch (error) {
return error.message;
}
},
};
module.exports = dads_jokes;
{
"name": "dads_jokes",
"version": "1.0.1",
"description": "A library to get a random fact.",
"version": "2.0.0",
"description": "dads_jokes Library is a lightweight JavaScript library designed to fetch dad jokes from open APIs",
"main": "index.js",

@@ -17,5 +17,5 @@ "scripts": {

"keywords": [
"random-facts",
"random",
"facts"
"dads_jokes",
"jokes",
"lame_jokes"
],

@@ -25,5 +25,5 @@ "author": "Imtiyaz Ali",

"bugs": {
"url": "https://github.com/Imtiyaz-ali/random_facts_generator/issues"
"url": "https://github.com/Imtiyaz-ali/dads_jokes/issues"
},
"homepage": "https://github.com/Imtiyaz-ali/random_facts_generator#readme"
"homepage": "https://github.com/Imtiyaz-ali/dads_jokes#readme"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc