Skip to content

Commit 5d6631c

Browse files
authored
Merge pull request #36 from halitsever/development
feat: 🎸 update endpoint & reddit api
2 parents 581f1df + 2197888 commit 5d6631c

35 files changed

+26361
-299
lines changed

.github/workflows/docs.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
36+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
37+
- name: Setup Node
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: 18
41+
cache: npm # or pnpm / yarn
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v3
44+
- name: Install dependencies
45+
run: npm ci # or pnpm install / yarn install / bun install
46+
- name: Build with VitePress
47+
run: |
48+
npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
49+
touch docs/.vitepress/dist/.nojekyll
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v2
52+
with:
53+
path: docs/.vitepress/dist
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
needs: build
61+
runs-on: ubuntu-latest
62+
name: Deploy
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v2

.github/workflows/publish.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish to NPM
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
- name: Setup Node
12+
uses: actions/setup-node@v2
13+
with:
14+
node-version: "16.x"
15+
registry-url: "https://registry.npmjs.org"
16+
- name: Install dependencies and test 🧪
17+
run: npm ci && npm run test
18+
- name: Publish package on NPM 📦
19+
run: npm publish
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center" class="logo-section">
2-
<img src="https://i.ibb.co/427dNQk/troll-face-1.png" height="80" width="80"/>
2+
<img src="https://i.ibb.co/yRSmZ6G/leo-laughing-1.png" height="80" width="80"/>
33
</br>
44
<img src="https://halitsever-api.vercel.app/api/repo-title?title=Random%20Memes">
55

@@ -23,8 +23,6 @@
2323

2424
- 🗒️ [**Text and Image**](#) - Get random memes as text & image
2525

26-
- 🌏 [**API**](#) - You can self host our random memes API
27-
2826
<a align="center" >
2927
<img src="https://halitsever-api.vercel.app/api/installation"/>
3028
</a>
@@ -35,13 +33,24 @@ Installation:
3533
npm install random-memes --save
3634
```
3735

38-
JS Example:
36+
Get random meme:
37+
38+
```javascript
39+
const memes = require("random-memes");
40+
41+
const fetchMeme = async () => {
42+
const meme = await memes.random();
43+
console.log(meme);
44+
};
45+
```
46+
47+
Get random meme from reddit:
3948

4049
```javascript
41-
const memes = require("memes");
50+
const memes = require("random-memes");
4251

4352
const fetchMeme = async () => {
44-
const meme = await memes.image.reddit({ locale: "en" });
53+
const meme = await memes.reddit({ locale: "en" });
4554
console.log(meme);
4655
};
4756
```

0 commit comments

Comments
 (0)