A TypeScript API wrapper I made for accessing my portfolio data easily and efficiently.
Technologies | |
---|---|
Yarn | |
NPM | |
Node | |
TypeScript | |
Axios |
npm i @mohammadelhsn/portfolio-api-wrapper
yarn add @mohammadelhsn/portfolio-api-wrapper
import API from '@mohammadelhsn/portfolio-api-wrapper'; // adjust path
// Define which project you want to get data for
const api = new API('COURSE');
async function Test() {
// Fetches all the assignments data for the course
const allAssignments = await api.getAssignment();
console.log(allAssignments);
// Fetch a specific assignments data
const assignment01 = await api.getAssignment('01');
console.log(assignment01);
// Fetch a specific task of an assignment
const task04Assignment01 = await api.getAssignment('01', '04');
console.log(task04Assignment01);
// Fetches all the lab data for the course
const allLabs = await api.getLab();
console.log(allLabs);
// Fetch a specific lab for a course
const lab01 = await api.getLab('01');
console.log(lab01);
// Fetch a specific task for a course
const task01lab01 = await api.getLab('01', '01');
console.log(task01lab01);
// Fetch the examples data for the course
const exampleData = await api.getExamples();
console.log(exampleData);
// Get the page data for the course
const pageData = await api.getPageData();
console.log(pageData);
// Get the tech data for the course
const techData = api.getTechData();
console.log(techData);
// Get the topics data for the course
const topicsData = api.getTopicsData();
console.log(topicsData);
}
// Call the function to test the code
Test();
🔧 Status: Actively Maintained — this project is considered feature-complete but continues to receive updates & improvements.