Skip to content

Fmasterpro27/FunKitJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FunKitJS

A lightweight JavaScript library for jokes, dad jokes, and roasts — bring the laughs to your Node.js and TypeScript projects.

npm version License


Table of Contents

  • Features
  • Installation
  • Quick Start
  • Usage
  • API Reference
  • TypeScript Support
  • Contributing
  • License

Features

  • 🎭 Random jokes from a curated collection
  • 👨 Dad jokes for maximum cringe
  • 🔥 Playful roasts for friendly banter
  • 📦 Zero runtime dependencies
  • ⚡ Fast and lightweight
  • 🟦 Built-in TypeScript support
  • 🔄 Python-style aliases included

Installation

Install from npm:

npm install @fmasterpro27/funkitjs

Requires Node.js 18 or higher.


Quick Start

CommonJS

const {
  joke,
  dad_joke,
  roast,
  get_joke,
  get_dad_joke,
  get_roast,
  version,
} = require("@fmasterpro27/funkitjs");

console.log(joke());
console.log(dad_joke());
console.log(roast());

console.log(get_joke());
console.log(get_dad_joke());
console.log(get_roast());

console.log(version);

ES Modules

import {
  joke,
  dad_joke,
  roast,
  get_joke,
  get_dad_joke,
  get_roast,
  version,
} from "@fmasterpro27/funkitjs";

console.log(get_joke());
console.log(get_dad_joke());
console.log(get_roast());

Usage

Random Joke

const { joke } = require("@fmasterpro27/funkitjs");

console.log(joke());

Dad Joke

const { dad_joke } = require("@fmasterpro27/funkitjs");

console.log(dad_joke());

Roast

const { roast } = require("@fmasterpro27/funkitjs");

console.log(roast());

Python-Style Aliases

const { get_joke, get_dad_joke, get_roast } = require("@fmasterpro27/funkitjs");

console.log(get_joke());
console.log(get_dad_joke());
console.log(get_roast());

API Reference

joke()

Returns a random joke.

const text = joke();

Returns:

string;

get_joke()

Alias for joke().

const text = get_joke();

Returns:

string;

dad_joke()

Returns a random dad joke.

const text = dad_joke();

Returns:

string;

get_dad_joke()

Alias for dad_joke().

const text = get_dad_joke();

Returns:

string;

roast()

Returns a random roast.

const text = roast();

Returns:

string;

get_roast()

Alias for roast().

const text = get_roast();

Returns:

string;

version

Returns the current package version.

const { version } = require("@fmasterpro27/funkitjs");

console.log(version);

Example:

0.1.0

TypeScript Support

FunKitJS includes built-in TypeScript definitions.

import {
  joke,
  dad_joke,
  roast,
  get_joke,
  get_dad_joke,
  get_roast,
  version,
} from "@fmasterpro27/funkitjs";

const text: string = joke();

console.log(version);

Project Structure

funkitjs/
├── src/
│   ├── index.js
│   ├── jokes.js
│   ├── roast.js
│   ├── version.js
│   └── data/
│       ├── jokes.json
│       ├── dad_jokes.json
│       └── roasts.json
├── tests/
│   ├── jokes.test.js
│   └── roasts.test.js
├── index.d.ts
├── package.json
├── LICENSE
└── README.md

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/my-feature
  1. Commit your changes
git commit -m "Add new feature"
  1. Push your branch
git push origin feature/my-feature
  1. Open a Pull Request

Please ensure all tests pass before submitting changes.


Links


License

This project is licensed under the Apache License 2.0.

See the LICENSE file for details.

About

A lightweight JavaScript library for jokes, dad jokes, and roasts — bring the laughs to your Node.js and TypeScript projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors