UNPKG

lolinck.js

Version:

A node.js library to interact with lolinck API.

26 lines (25 loc) 709 B
const got = require("got"); const url = "https://api.lolinck.xyz/v1/check/"; module.exports = async (link, options) => { var validTypes = ["json", "text", "xml"]; if (!validTypes.includes(options.type.toLowerCase())) { throw new Error("Invalid type"); } var res = await got .post(url, { json: { link: link, real_time: options.real_time || false, type: options.type || "json", }, }) .json(); var formatRes = { url: res.url, nsfw: res.NSFW, malware: res.MALWARE, phising: res.PHISHING, ip_logging: res.IP_LOGGING, }; return formatRes; };