{"id":20207573,"url":"https://github.com/heyskidee/plug","last_synced_at":"2026-02-11T02:09:09.287Z","repository":{"id":200794485,"uuid":"487511433","full_name":"HeySkidee/plug","owner":"HeySkidee","description":"Simplify Your API Interactions!","archived":false,"fork":false,"pushed_at":"2024-09-15T16:16:28.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T06:39:53.609Z","etag":null,"topics":["axios","cdn","fetch","http","http-requests","javascript","npm-package"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/the-plug","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HeySkidee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-01T10:49:55.000Z","updated_at":"2024-09-16T21:02:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"e897994d-6010-4c2b-8c9c-055dfcf30c98","html_url":"https://github.com/HeySkidee/plug","commit_stats":null,"previous_names":["heyskidee/scroll-limiter","heyskidee/plug"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HeySkidee/plug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeySkidee%2Fplug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeySkidee%2Fplug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeySkidee%2Fplug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeySkidee%2Fplug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeySkidee","download_url":"https://codeload.github.com/HeySkidee/plug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeySkidee%2Fplug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262213186,"owners_count":23276061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","cdn","fetch","http","http-requests","javascript","npm-package"],"created_at":"2024-11-14T05:29:58.554Z","updated_at":"2026-02-11T02:09:04.239Z","avatar_url":"https://github.com/HeySkidee.png","language":"JavaScript","readme":"# Plug\n\nA wrapper for the fetch API that simplifies HTTP requests \n\n[![NPM Downloads](https://badgen.net/npm/dt/the-plug)](https://npmcharts.com/compare/the-plug?minimal=true)\n[![NPM Version](https://badgen.net/npm/v/the-plug)](https://npmjs.org/package/the-plug)\n\n---\n\n## Installation\n\nuse npm: \n```bash\nnpm i the-plug\n```\nor cdn:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/the-plug@1.0.8/plug.js\"\u003e\u003c/script\u003e\n```\n\n---\n\n## Usage:\n\n### Example (express):\n\n```javascript\nconst express = require('express')\nconst app = express()\n\nconst plug = require('the-plug')\n\napp.get('/', async (req, res)=\u003e{\n    const response = await plug.get('https://official-joke-api.appspot.com/random_joke')\n\n    res.json(response)\n})\n\napp.listen(3000)\n```\n\n### Example (HTML):\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/the-plug@1.0.8/plug.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003ch2\u003eRandom Joke\u003c/h2\u003e\n    \u003cp\u003e\u003c/p\u003e\n    \u003cp\u003e\u003c/p\u003e\n\n    \u003cscript\u003e\n        async function getJoke() {\n            const joke = await plug.get('https://official-joke-api.appspot.com/random_joke');\n\n            document.querySelectorAll('p')[0].innerHTML = joke.setup;\n            document.querySelectorAll('p')[1].innerHTML = joke.punchline;\n        }\n\n        getJoke();\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Additional Examples:\n\n### POST Request\n\nTo send data to a server, you can use the `post` method:\n\n```javascript\nconst data = { name: \"John Doe\", age: 30 };\nconst response = await plug.post('https://your-api-endpoint.com/users', data, {\n    'Content-Type': 'application/json'\n});\nconsole.log(response);\n```\n\n### PUT Request\n\nTo update existing data, use the `put` method:\n\n```javascript\nconst updatedData = { name: \"John Doe\", age: 31 };\nconst response = await plug.put('https://your-api-endpoint.com/users/1', updatedData, {\n    'Content-Type': 'application/json'\n});\nconsole.log(response);\n```\n\n### DELETE Request\n\nTo delete data from a server, use the `delete` method:\n\n```javascript\nconst response = await plug.delete('https://your-api-endpoint.com/users/1', {\n    'Authorization': 'Bearer your-token-here'\n});\nconsole.log(response);\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyskidee%2Fplug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyskidee%2Fplug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyskidee%2Fplug/lists"}