dnjokes-api-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published
logo

Deez Nuts Jokes API Wrapper

This is a TypeScript/JavaScript wrapper for the Deez Nuts Jokes API. The original repo for the API can be found at DNJokes-API, also available on RapidAPI.

last update stars open issues license GitHub Workflow Status Snyk Vulnerabilities for GitHub Repo GitHub Workflow Status

Report Bug or Suggest Feature


📔 Table of Contents

🌟 About the Project

👾 Tech Stack

🧰 Getting Started

⚙️ Installation

Install DNJokes-API Wrapper with npm

npm i dnjokes-api-wrapper

or with yarn

yarn add dnjokes-api-wrapper

or use as an inline script with a CDN

<script src="https://cdn.jsdelivr.net/npm/dnjokes-api-wrapper/lib/cjs/index.min.js"></script>

👀 Usage

To use the wrapper, you need to import it into your project.

ESM Module

import getAllDNJokes from 'DNJokes-API-Wrapper';

getAllDNJokes().then((res) => {
  console.log(res);
});

CommonJS

const DNJokes = require('DNJokes-API-Wrapper');

DNJokes.getAllDNJokes().then((res) => {
  console.log(res);
});

🚩 Commands

These are the commands you can use with the wrapper

// Get an array of all jokes in the database
getAllDNJokes(max_results: number); // putting a value in the function will define the maximum number of jokes to return

// Get a random joke from the database
getRandomDNJoke();

// Get a joke by ID
getDNJokeById(dn_id: number); // put the ID of the joke you want to get in the function

// Get a joke by search query
getDNJokeByQuery(keyword: string); // put the search query in the function

🧪 Running Tests

To run tests, run the following command

  npm test

👋 Contributing

Contributions are always welcome! Open an issue with any issues or requests!

⚠️ License

Distributed under the MIT License. See LICENSE.md for more information.

🤝 Contact

devious@deviouslab.dev deviouslab.dev

💎 Acknowledgements

Package Sidebar

Install

npm i dnjokes-api-wrapper

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

22.3 kB

Total Files

21

Last publish

Collaborators

  • deviouslab