random-bunny
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

random-bunny

Get a random image url from a subreddit of your choosing.

Install

npm install --save random-bunny

or if you're using yarn

yarn add random-bunny

Binary

The project can be downloaded as a binary for your system via the GitHub Releases or Gitea Releases page.

Usage

import randomBunny from "random-bunny";

// ... In an async function
const result = await randomBunny('rabbits', 'hot');
console.log(result);

API

randomBunny()

Returns a json string for a random post. Accepts 2 arguments: subreddit, and sortby ('new', 'hot', 'top')

The json string which gets returned consists of:

  • archived
  • downs
  • hidden
  • permalink
  • subreddit
  • subredditSubscribers
  • title
  • ups
  • url

sortBy will default to 'hot' if not given or invalid

CLI

Random bunny can also be used as a CLI. This is accessible via the executable (see git releases) or via src/cli.ts

For more details, see the documentation.

Notes

Links

License

MIT © Vylpes

Package Sidebar

Install

npm i random-bunny

Weekly Downloads

71

Version

2.2.0

License

MIT

Unpacked Size

26.1 kB

Total Files

47

Last publish

Collaborators

  • vylpes