Skip to content

Commit 581f1df

Browse files
committed
refactor: 💡 bump to 3.2.0
Remove old canvas required methods, update docs & codebase BREAKING CHANGE: 🧨 Canvas required methods is removed
1 parent efb1fa1 commit 581f1df

29 files changed

Lines changed: 3846 additions & 769 deletions

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"printWidth": 280
5+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Halit Sever
3+
Copyright (c) 2024 Halit Sever
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 48 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,63 @@
1-
<!--
2-
Title: Random Meme Generator, random-memes
3-
Description: Random reddit & custom api meme genarator and custom meme maker module for node.js
4-
Author: halitsever
5-
-->
6-
<h1>random-memes Random Meme Generator</h1>
7-
<img align="right" width="250" height="250" src="https://i.ibb.co/VC9QTCk/68747470733a2f2f692e6962622e636f2f705774425876462f59656e692d50726f6a652e706e67-2.png">
8-
<p align="left">
9-
<img src="https://img.shields.io/npm/dt/random-memes?color=red&style=for-the-badge" alt="random-memes-download-count">
10-
<img src="https://img.shields.io/librariesio/release/npm/random-memes?style=for-the-badge" alt="random-memes-dependencies"> <img src="https://img.shields.io/npm/l/random-memes?style=for-the-badge" alt="random-memes-license">
11-
<img src="https://img.shields.io/librariesio/dependents/npm/random-memes?color=green&style=for-the-badge" alt="random-memes-dependents">
12-
<img src="https://img.shields.io/npm/v/random-memes?style=for-the-badge" alt="random-memes-version">
13-
<br>
14-
15-
Random reddit & custom api meme genarator and custom meme maker module for node.js
16-
<br>
17-
<a><b><a href="https://github.com/halitsever/random-memes/wiki/Documentation">Documentation Page</a></b></a><br>
18-
What can be done with random-memes?:<br>
19-
<a><b><a href="#random-memes-custom">Create your own memes with random-memes!</a></b></a><br>
20-
<a><b><a href="#random-memes">Create random meme with custom api</a></b></a><br>
21-
<a><b><a href="#random-memes-reddit">Create random meme with reddit api</a></b></a><br>
22-
23-
24-
25-
26-
27-
<a name="random-memes"></a>
1+
<p align="center" class="logo-section">
2+
<img src="https://i.ibb.co/427dNQk/troll-face-1.png" height="80" width="80"/>
3+
</br>
4+
<img src="https://halitsever-api.vercel.app/api/repo-title?title=Random%20Memes">
5+
6+
<p align="center">
7+
🌁 Random reddit & custom api meme genarator and custom meme maker module for node.js<br>
8+
<br/>
9+
<br/>
10+
<img src="https://img.shields.io/github/sponsors/halitsever"/>
11+
<img src="https://img.shields.io/github/license/halitsever/repo_name"/>
12+
</p>
13+
<p align="center">
14+
<a align="center" href="https://halitsever.github.io/random-memes/">Documentation</a>
15+
</p>
2816
</p>
29-
<h1>Get random memes from custom api</h1>
30-
31-
<h2>Async/Await:</h2>
32-
<code>await memes.random()</code>
33-
<h2>Promise:</h2>
34-
<code>const memes = require("random-memes");</code>
35-
<p></p>
36-
<code>memes.random().then(meme => {</code>
37-
<p></p>
38-
<code>console.log("Meme generated: " + meme.image)</code><p></p>
39-
<code>//returns image link</code>
40-
41-
<p></p><code>console.log("Category: " + meme.category)</code><p></p>
42-
<p></p><code>//returns category</code><p></p>
4317

44-
<code>console.log("Caption: " + meme.caption)</code><p></p>
45-
<code>//returns image caption</code>
18+
<a align="center">
19+
<img src="https://halitsever-api.vercel.app/api/details"/>
20+
</a>
4621

47-
<code>console.log("ID: " + meme.id)</code><p></p>
48-
<code>//returns id</code>
22+
- 🧑‍💻 [**Reddit Support**](#) - You can fetch random memes on reddit
4923

50-
<code>})</code><br>
24+
- 🗒️ [**Text and Image**](#) - Get random memes as text & image
5125

52-
<a name="random-memes-reddit"></a>
53-
<img width="250" height="250" src="https://i.ibb.co/NZbLZPQ/68747470733a2f2f692e6962622e636f2f5643395154436b2f36383734373437303733336132663266363932653639363236.png" align="left">
54-
<h1>Get random memes from reddit api</h1>
55-
<h2>Async/Await:</h2>
56-
<code>await memes.fromReddit()</code>
57-
<h2>Promise:</h2>
58-
<code>
59-
const memes = require("random-memes");</code><br>
60-
<code>memes.fromReddit("en").then((meme)=>{</code><br>
61-
<code>console.log(meme);</code><br>
62-
<code>console.log(meme.image);</code><br>
63-
<code>})</code>
26+
- 🌏 [**API**](#) - You can self host our random memes API
6427

28+
<a align="center" >
29+
<img src="https://halitsever-api.vercel.app/api/installation"/>
30+
</a>
6531

32+
Installation:
6633

67-
<a name="random-memes-custom"></a>
68-
<br><br>
69-
<h1>Make your own memes! with random-memes</h1>
70-
<img src="https://i.ibb.co/M87921Q/Ba-l-ks-z.png">
71-
<h2>Async/Await:</h2>
72-
73-
<code>let memecontent = {<p></p>
74-
toptext: "Hello",<p></p>
75-
bottomtext: "World",<p></p>
76-
getdataurl: true<p></p>
77-
// getbuffer: true,<p></p>
78-
// savefile: true,<p></p>
79-
// "toptext-x":100, "toptext-y":50, "bottomtext-x":100, "bottomtext-y":300,<p></p>
80-
// filename: "filename",<p></p>
81-
// fileformat: "png"<p></p>
82-
//pictureheight: 1200,<p></p>
83-
//picturewidth: 1200<p></p>
84-
};<p></p>
85-
memes.createMeme("IMAGE_URL", memecontent).then(meme => {<p></p>
86-
<p></p>console.log(meme)<p></p>
87-
// returns dataurl, if you want save file or get buffer data just edit memecontent object<p></p>
88-
});
89-
</code><br>
90-
<code> await memes.createMeme("IMAGE_URL", memecontent);</code>
91-
<h2>Promise:</h2>
92-
<code>let memecontent = {<p></p>
93-
toptext: "Hello",<p></p>
94-
bottomtext: "World",<p></p>
95-
getdataurl: true<p></p>
96-
// getbuffer: true,<p></p>
97-
// savefile: true,<p></p>
98-
// "toptext-x":100, "toptext-y":50, "bottomtext-x":100, "bottomtext-y":300,<p></p>
99-
// filename: "filename",<p></p>
100-
// fileformat: "png"<p></p>
101-
//pictureheight: 1200,<p></p>
102-
//picturewidth: 1200<p></p>
103-
};<p></p>
104-
memes.createMeme("IMAGE_URL", memecontent).then(meme => {<p></p>
105-
<p></p>console.log(meme)<p></p>
106-
// returns dataurl, if you want save file or get buffer data just edit memecontent object<p></p>
107-
});
108-
</code>
109-
<p align="center">Also you can check <a href="https://github.com/halitsever/random-memes/tree/main/examples">online meme creator example</a></p>
110-
<p align="center"><a align="center" href="https://github.com/halitsever/random-memes/wiki/Documentation">and documentation page</a></p>
34+
```bash
35+
npm install random-memes --save
36+
```
11137

38+
JS Example:
11239

113-
<h1>Write code to have fun with your friends
114-
</h1>
40+
```javascript
41+
const memes = require("memes");
11542

116-
<img align="left" src="https://i.ibb.co/X5fcJBx/hey.png">
117-
<h2>Async/Await:</h2>
43+
const fetchMeme = async () => {
44+
const meme = await memes.image.reddit({ locale: "en" });
45+
console.log(meme);
46+
};
47+
```
11848

119-
<code>
120-
let memecontent = {</code><br>
121-
<code> photo1: "./me.png",</code><br>
122-
<code> "photo1-x": 280,</code><br>
123-
<code> "photo1-y": 90,</code><br>
124-
<code> photo2: "./myfriend.png",</code><br>
125-
<code> "photo2-x": 210,</code><br>
126-
<code> "photo2-y": 60,</code><br>
127-
<code> savefile: true,</code><br>
128-
<code> filename: "withmyfriend",</code><br>
129-
<code> fileformat: "png",</code><br>
130-
<code> pictureheight: 500,</code><br>
131-
<code> picturewidth:500</code><br>
132-
<code> };</code><br>
49+
<a align="center" href="https://github.com/halitsever/random-memes/issues">
50+
<img src="https://halitsever-api.vercel.app/api/issue"/>
51+
</a>
13352

134-
135-
<code>await memes.createDuoMeme("IMAGE_URL", memecontent)</code>
136-
<br>
137-
<br><br>
138-
<br><br>
139-
<br><br>
140-
<br>
141-
<h2>Promise:</h2>
142-
<code>
143-
let memecontent = {</code><br>
144-
<code> photo1: "./me.png",</code><br>
145-
<code> "photo1-x": 280,</code><br>
146-
<code> "photo1-y": 90,</code><br>
147-
<code> photo2: "./myfriend.png",</code><br>
148-
<code> "photo2-x": 210,</code><br>
149-
<code> "photo2-y": 60,</code><br>
150-
<code> savefile: true,</code><br>
151-
<code> filename: "withmyfriend",</code><br>
152-
<code> fileformat: "png",</code><br>
153-
<code> pictureheight: 500,</code><br>
154-
<code> picturewidth: 500</code><br>
155-
<code> };</code><br>
156-
<code>memes</code><br>
157-
<code> .createDuoMeme(</code><br>
158-
<code> "./bear.png", memecontent);</code>
159-
</a><br>
160-
<b>All Examples:</b><br>
161-
<b><a href="https://github.com/halitsever/random-memes/blob/main/examples/Telegram-Bot-Random-Meme-Generator-Example/Telegram-Bot-Random-Memes.js">Telegram (Telegraf.js) Random-Meme Generator</a></b>
162-
<br> <b><a href="https://github.com/halitsever/random-memes/blob/main/examples/Discord-Duo-Meme-Creator-Example/createDuo-Meme-Discord-Example.js">Discord (Discord.js) Create Duo Meme</a></b>
163-
<br> <b><a href="https://github.com/halitsever/random-memes/tree/main/examples/Online-Express-Meme-Creator-Example">Online Meme Creator with Express.js</a></b>
164-
<br> <b><a href="https://github.com/halitsever/random-memes/blob/main/examples/Get-Reddit-Posts-Example/Get-Reddit-Memes.js">Get Reddit Memes</a></b>
53+
<a align="center">
54+
<img src="https://halitsever-api.vercel.app/api/sponsor"/>
55+
</a>
16556

57+
<a align="center">
58+
<img src="https://halitsever-api.vercel.app/api/license"/>
16659
</a>
167-
<br>
168-
<br>
60+
61+
<p align="center">
62+
MIT LICENSE 2019-present | <a href="https://github.com/halitsever">Halit Sever</a>
63+
</p>

docs/.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/index.html

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)