Socket
Socket
Sign inDemoInstall

chucklejs

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chucklejs

A wrapper for jokeapi.dev. Get random jokes with categorical sorting.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source
🤣 chucklejs

As you can tell, we can't afford a logo designer (Yes, that's Comic Sans 🤣)
Downloads: /week bundle size module formats: cjs, esm

Installation

Use the install command of your favourite package manager!

e.g.

npm install chucklejs

Usage

Simply import which ever utilities you would like to use

e.g.

import { getJoke } from "chucklejs";

try {
  console.log(
    await getJoke(["Programming", "Dark", "Pun"], {
      blacklistFlags: ["nsfw", "racist", "explicit"],
      types: ["twopart"],
    })
    /*  [
            {
                category: "Programming",
                type: "twopart",
                setup: "why do python programmers wear glasses?",
                delivery: "Because they can't C.", 🤣🤣🤣
            }
        ]
    */
    ]
  );
} catch (error) {
  /* Error Handling */
}

Docs

function getJoke(
  categories: Category[] | undefined,
  { blacklistFlags, amount, language, contains, types }: Options
): Promise<
  (
    | {
        category: Category;
        type: "single";
        joke: string;
      }
    | {
        category: Category;
        type: "twopart";
        setup: string;
        delivery: string;
      }
  )[]
>;

Keywords

FAQs

Last updated on 08 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc