From Ali El0malki
Official version 0.12.1
- ✅️ Change the Program to OOP.
- ✅️ add New Method to REQUEST.
- ✅️ add Paramas to Request URL [New Method].
- ✅️ Update performance.
- ✅️ Fixed Bugs.
- ❌️ add POST Method.
- ❌️ add PUT Method.
- ❌️ add DELETE Method.
Simple Functionality to REQUEST Data from any API in TypeScript.
API is the acronym for application programming interface — a software intermediary that allows two applications to talk to each other. APIs are an accessible way to extract and share data within and across organizations. APIs are all around us. Every time you use a rideshare app, send a mobile payment, or change the thermostat temperature from your phone, you’re using an API.
one line to request api and catch errors, with high performance.
-- Changes in v0.12.0 :
- ✅️ Change the Program to OOP.
- ✅️ add New Method to REQUEST.
- ✅️ add Paramas to Request URL [New Method].
- ✅️ Update performance.
- ✅️ Fixed Bugs.
add the package using npm!
npm i degree_api
// -- import degree_api -- //
import { degapi } from "degree_api";
// -- API URL [ Variable ] -- //
const API_URL = "API_URL_HERE";
// -- Using New Method without [Params] in Project -- //
degapi.nGet(URL_API);
// -- Using New Method with [Params] in Project -- //
degapi.nGet(URL_API, <Your_Param>);
// -- Output -- //
// if => True => Congrats! Your response Here 👏 //
// if => False => The cause of the error will appear Here. //
Example with JsonPlaceholder API ..
// -- import degree_api -- //
import { degapi } from "degree_api";
// -- API URL [ Variable ] -- //
const API_URL = "https://jsonplaceholder.typicode.com/todos";
// -- Search in Todos using ID -- //
// -- Using New Method with [Param] in Project -- //
degapi.nGet(URL_API, "1");
// -- Output -- //
{ userId: 1, id: 1, title: 'delectus aut autem', completed: false }
// -- import degree_api -- //
import { degapi } from "degree_api";
// -- API URL [ Variable ] -- //
const API_URL = "API_URL_HERE";
// -- Using OldGetRequest in Project -- //
degapi.oGet(URL_API);
// -- Output -- //
// if => True => Congrats! Your response Here 👏 //
// if => False => The cause of the error will appear Here. //
-
Have a problem or Bugs 🤔
send on issues.
-
Have thing to help me 🤔
send on pull request.
If you would like to support me,
and make me continue to publish and develop.
Please Star
The Repository.
Thank You 😊