1.0.0 • Published 4 years ago
safecall.js v1.0.0
safecall.js
Usage
Add the package
To start, you will need to add the package. To do that, simply run npm i safecall.js
. In your code, add the following:
const safecall = require("safecall.js");
Now you can use any of the functions below! All of the function return a Promise (just an FYI).
Getting a IP's information
safecall.ip("IP").then(result => console.log(result));
The code above should return a 200 OK message. (JSON)
Report an IP
safecall.report("KEY", "IP", "OPTIONAL REASON").then(result => console.log(result));
The code above should return a 200 OK message. (JSON)
Get the statistics for SafeCall API
safecall.stats().then(result => console.log(result));
The code above should return a 200 OK message. (JSON)
Unmentioned feature
If this package does not have a function for a certain API endpoint, we have a function that lets you easily interact with any endpoint!
safecall.api("PATH", "METHOD").then(result => console.log(result));
This will return a JSON from the endpoint specified.
Note: "PATH" is the endpoint (e.g call/127.0.0.1), and "METHOD" is the HTTP method (e.g POST).
1.0.0
4 years ago