1.2.9 • Published 2 months ago

beta-wooffer v1.2.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Table of contents

Installation

npm i wooffer

or

yarn add wooffer

How to use Wooffer

Add Below Code into your Root file Like App.js or Index.js

Example Code

const wooffer = require("wooffer");
wooffer(process.env.token, process.env.serviceToken);

Add Below Code into your .env File

token = "<Your Token>";
serviceToken = "<Your Service Token>";

Monitor Real-time request analytics

To monitor real-time request usage, add the code into the root files such as app.js or index.js. Just below, create the 'app' variable and make the necessary modifications.

const express = require("express");
const app = express();
app.use(wooffer.requestMonitoring);

Create custom log

To create Create Custom Alert Message

const wooffer = require("wooffer");

wooffer.alert("EventName: Login \nUsername:Jhon Due");

To create Create Custom Success Message

const wooffer = require("wooffer");

wooffer.success("EventName: Login \nUsername:Jhon Due");

To create Create Custom Fail Message

const wooffer = require("wooffer");

wooffer.fail("EventName: Login \nUsername:Jhon Due");

Create third party API Call

Integrating Wooffer for third-party API calls is straightforward. Just use wooffer.axios instead of axios. Here's a simple example.

const wooffer = require("wooffer");

const config = {
  method: "post",
  maxBodyLength: Infinity,
  url: "https://countriesnow.space/api/v0.1/countries/population/cities",
  headers: {
    "Content-Type": "application/json",
  },
  data: {
    city: "lagos",
  },
};

const response = await wooffer.axios.request(config);

or

const wooffer = require("wooffer");

const response = await wooffer.axios.post(
  `https://countriesnow.space/api/v0.1/countries/population/cities`,
  {
    city: "lagos",
  }
);
1.2.9

2 months ago

1.2.8

3 months ago

1.2.7

4 months ago

1.2.6

4 months ago

1.2.5

4 months ago

1.2.4

4 months ago

1.2.3

4 months ago

1.2.1

4 months ago

1.2.0

4 months ago

1.1.6

5 months ago

1.1.5

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago