1.0.0 • Published 10 months ago

node-jokes v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

node-jokes

A free and open source library for one-liner random developer friendly jokes in node

Installation

Install node-jokes with npm

npm install node-jokes

Usage/Examples

Get random joke

import NodeJoke from "node-jokes";

const joke = NodeJoke.getJoke();
console.log(joke);

Get multiple jokes

import NodeJoke from "node-jokes";

const jokes = NodeJoke.getJokes();
console.log(jokes);

Parameter Reference

Get random joke

const joke = NodeJoke.getJokes("en", "general");
ParameterTypeDescription
langstringLanguage preference
categorystringcategory preference

Get multiple jokes

const jokes = NodeJoke.getJokes(10, "en", "general");
ParameterTypeDescription
limitnumberNumbers of jokes required, default is 10
langstringLanguage preference
categorystringcategory preference

Parameters supports

lang

ParameterDescription
enEnglish
espSpanish
hiHindi
frFrench
jpJapanese

category

ParameterDescription
generaljokes related to general category
punjokes related to pun category
lifejokes related to life category
programmingjokes related to programming category
humorjokes related to humor category
knock-knockjokes related to knock-knock category

Run Locally

Clone the project

git clone https://github.com/sandeep-shome/node-jokes.git

Go to the project directory

cd my-project

Install dependencies

npm install

Start the server

npm run start

Appendix

Node-Joke is a completely free and open-source joke-as-a-service project designed for entertainment. It stores all jokes internally within the package, which can lead to limitations in the randomness of generated jokes. After delivering a few random jokes, there's a possibility of repetition.

As a solo developer, I may not be able to add as many jokes as desired. This project is currently in beta, and I aim to expand the joke library in the future. Enjoy the jokes available now!

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

Authors

License

MIT