UNPKG

@kiwitheboss/memejs

Version:

A simple, fast, and fun meme generator, now with a new API!

36 lines (29 loc) 1.17 kB
# memejs Retrieve memes easily from reddit. <p><a href="https://www.npmjs.com/package/memejs" rel="nofollow"><img src="https://badgen.net/npm/dt/memejs" alt="Downloads" /></a></p> ## Installation ```bash npm install @kiwitheboss/memejs --save ``` ## How to use memejs ```js const { meme } = require('@kiwitheboss/memejs'); memeAsync() // Use meme('subredditname') to filter subreddits .then(m => console.log(m)) // Get the JSON output .catch(e => console.log(e)); // Handle any errors ``` Example of JSON output: ```jsonc { title: 'Me irl', // The title of the meme url: 'https://i.redd.it/zdaqicupnzq41.jpg', // The image URL author: 'godofeverythingelse', // Optional subreddit: 'me_irl', // subreddit name created: '2020-03-05 19:55:59.000', // Date of post created_utc: '2020-03-05 11:55:59.000', // UTC time nsfw: false // If true, the image is NSFW [NEW] } ``` **Note:** v3 is now with more data and is more accurate. Created by [Kyle](https://github.com/scrap) and Nuno (nuno#4160) Honorable mention [marshallasch](https://github.com/marshallAsch/) --> [reasoning](https://github.com/Nuno135/memejs/pull/6)