https://github.com/sxmabel/memegen
Generate memes either randomly or by query.
https://github.com/sxmabel/memegen
giphy-api meme-generator memegenerator memes npm-package random-memes reddit-api typescript
Last synced: 11 months ago
JSON representation
Generate memes either randomly or by query.
- Host: GitHub
- URL: https://github.com/sxmabel/memegen
- Owner: SxMAbel
- License: apache-2.0
- Created: 2023-06-06T17:26:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-02T19:49:52.000Z (over 2 years ago)
- Last Synced: 2025-02-17T03:09:38.783Z (11 months ago)
- Topics: giphy-api, meme-generator, memegenerator, memes, npm-package, random-memes, reddit-api, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/memegen-techstack
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## How To Use memegen-techstack
## Typescript
```ts
import { MemeGen } from "memegen-techstack";
```
## Javascript
```js
const { MemeGen } = require("memegen-techstack");
```
## Get Random Memes
**Example**
```js
const memeGen = new MemeGen();
const meme = await memeGen.random.fetch();
```
> **`meme` will return:**
- HDPreview `- string`
- Author `- string`
- NSFW `- boolean`
- Preview `- array`
- Spoiler `- boolean`
- Title `- string`
- URL `- string`
> **Each time you use `.random.fetch()` you will get a different meme.**
## Search For A Meme From Your Input Phrase
## Using Reddit API
**Example**
```js
const memeGen = new MemeGen();
const meme = await memeGen.reddit.fetch({ query: "", sort: "" });
```
> **`meme` will return `.memes` either an array or a string if no memes found for the search input.**
**`.memes` array is consists of:**
- title `- string`
- url `- string`
## Using Giphy API
**Example**
```js
const memeGen = new MemeGen();
const meme = await memeGen.giphy.fetch({
giphyApiKey: "apikey",
query: "",
limit: 1,
});
```
> **`meme` will return `.memes` if limit greater than 1. `.title` & `.imageURL` will return null.**
> **`meme` will return `.title` & `.imageURL` if limit is 1. `.memes` will return null.**
NOTE: **The `.memes` will return and array with object(s):**
- title `- string`
- imageURL `- string`