
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
blague.xyz
Advanced tools
Blague.xyz is a package to get jokes and FML easily from the Blague.xyz API.
🇬🇧 Jokes/FML in english are supported 🇫🇷 Blagues/Vie de merde en français sont supportées
$ npm install --save blague.xyz
You need an API Key to send request to the Blague.xyz API. Click here to get one.
const { Client } = require("blague.xyz");
const joker = new Client("API token", {
defaultLang: "fr" // The default language for jokes and fml
});
// Gets a random joke. As no language is specified, it will use the default language of the client, "fr" in our case.
joker.randomJoke().then((joke) => {
console.log(joke.question); // Que dit une feuille quand elle tombe dans l'eau ?
console.log(joke.answer); // J'ai papier
console.log(joke.toString()); // Que dit une feuille quand elle tombe dans l'eau ?\nJ'ai papier
console.log(joke.toDiscordSpoils()); // Que dit une feuille quand elle tombe dans l'eau ?\n\n||J'ai papier||
console.log(joke.id); // 71
});
// Gets an english joke. If you specify a language, it will use it instead of the default language.
joker.dailyJoke("en").then((joke) => {
console.log(joke.question); // What is the only dog you can eat ?
console.log(joke.answer); // A Hot Dog
});
// Gets a joke with its ID
joker.getJoke(10, "fr").then((joke) => {
console.log(joke.question); // Que dit une fleur qui a eu zéro à un contrôle ?
console.log(joke.answer); // Qu'elle s'est plantée
});
// Gets the joke list. [premium only]
joker.listJoke().then((list) => {
console.log(list); // [ {joke}, {joke}, {joke} ]
});
const Client = require("blague.xyz");
const joker = new Client("API token", {
defaultLang: "fr" // The default language for jokes and fml
});
// Gets a random vdm. As no language is specified, it will use the default language of the client, "fr" in our case.
joker.randomVDM().then((vdm) => {
console.log(vdm.content); // Aujourd'hui, j'ai acheté une voiture d'occasion à un de mes amis. Après avoir ramené la voiture à la maison et l'avoir inspectée, j'ai trouvé l'une des boucles d'oreilles de ma femme sur le siège arrière.
});
// Gets a random vdm with type "hot".
joker.randomVDM("hot").then((vdm) => {
console.log(vdm.content); // Censured. Use the package to get some hot vdm...
});
// Gets an english fml. If you specify a language, it will use it instead of the default language.
joker.getVDM("normal", "en").then((fml) => {
console.log(fml.content); // Today, a little girl asked me how I could be so fat and still have small boobs.
});
// Gets a vdm with its ID
joker.listVDM().then((list) => {
console.log(list); // [ {vdm}, {vdm}, {vdm} ]
});
FAQs
Wrapper pour Blague.xyz (blagues aléatoires, blague du jour, etc...)
The npm package blague.xyz receives a total of 22 weekly downloads. As such, blague.xyz popularity was classified as not popular.
We found that blague.xyz demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.