npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@arifzyn/api

v1.0.5

Published

Simple API Wrapper For Arifzyn API

Downloads

220

Readme

@arifzyn/api

NPM version License: MIT

Simple API Wrapper for Arifzyn API. This package provides an easy-to-use interface to interact with the API.

Features

  • Supports both CommonJS and ES Modules.
  • Handles GET and POST requests.
  • Supports custom query parameters and headers.
  • TypeScript support with type definitions.

Installation

Install via npm:

npm install @arifzyn/api

Or using yarn:

yarn add @arifzyn/api

Usage

Importing the Package

You can import the package in both CommonJS and ES module formats.

CommonJS

const API = require("@arifzyn/api");

ES Modules

import API from "@arifzyn/api";

Example Usage

  1. Initialize the API Wrapper
const api = new API("https://api.arifzyn.tech", {
  apikey: "YOUR_API_KEY", // Optional, if your API requires an API key
});
  1. GET Request Example
api
  .get("/endpoint", { param1: "value1", param2: "value2" })
  .then((response) => {
    console.log("Response:", response);
  })
  .catch((error) => {
    console.error("Error:", error);
  });
  1. POST Request Example
api
  .post("/endpoint", { key1: "value1", key2: "value2" })
  .then((response) => {
    console.log("Response:", response);
  })
  .catch((error) => {
    console.error("Error:", error);
  });
  1. GET Feature By Category
api
  .list("ai")
  .then((response) => {
    console.log("Response:", response);
  })
  .catch((error) => {
    console.error("Error:", error);
  });

API Documentation

Constructor

new API(baseURL: string, options?: APIOptions)

  • baseURL: Base URL for the API (e.g., https://api.arifzyn.tech).
  • options: Optional configuration, including API key and custom headers.

Methods

get(path: string, query?: Record<string, any>, options?: AxiosRequestConfig): Promise<any | Buffer | APIResponse>

  • path: Endpoint path (e.g., /ai/animediff).
  • query: Query parameters as an object.
  • options: Additional Axios configuration options.
  • Returns: API response or buffer (in case of binary data).

post(path: string, data?: Record<string, any>, options?: AxiosRequestConfig): Promise<any | Buffer | APIResponse>

  • path: Endpoint path.
  • data: Data payload for the request.
  • options: Additional Axios configuration options.
  • Returns: API response or buffer.

Configuration

To use the package with TypeScript, make sure you have the necessary type definitions. The package includes a @types folder with index.d.ts.

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Issues

For any issues, please open a GitHub issue.


Note: This wrapper is developed and maintained by Arifzyn19. For API-related issues or usage, please refer to the official documentation or contact support.


Additional Information:

  • Badge in the README header adds a professional touch, showing license and version info.
  • Usage section provides examples for importing and using the package.
  • API Documentation gives a brief explanation of parameters in each method.
  • Contributing and License sections make it easy for others to contribute or understand usage permissions.

Feel free to customize this README as needed or add more details if required.

Thanks To

A huge thank you to neoxr on GitHub. Your work has been a true source of inspiration and guidance. The quality and creativity of your contributions have pushed me to think bigger and aim higher in my own projects. Thank you for sharing your talent and insights with the AR-API impact is greatly appreciated.