You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@safelyx/api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safelyx/api

API client for Safelyx.

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Safelyx API

deno npm jsr

Safelyx API client

Safelyx API client for Deno, Node/NPM and browser. It has no dependencies.

You can find the API documentation at https://safelyx.com/safe-api.

Some things to note:

  • It's simply making an HTTP request to the Safelyx API.

  • It provides types (and examples in JSDoc) for the results and for the parameters.

  • If the request to the API fails (HTTP error), it will throw an error, so you might want to wrap it in a try/catch block.

Usage

It has a method per API endpoint.

Deno

import safelyx from 'jsr:@safelyx/api@0.1.0'; // or import safelyx from 'https://deno.land/x/safelyx@0.1.0/mod.ts';

const checkResult = await safelyx.checkLink('https://example.com');

console.log(checkResult.result); // Outputs a safety score between 0 (unsafe) and 10 (safe). -1 if there was an error, -2 if there are no checks remaining.

Node/NPM

npm install --save-exact @safelyx/api
const safelyx = require('@safelyx/api'); // or import safelyx from '@safelyx/api';

const checkResult = await safelyx.checkLink('https://example.com');

console.log(checkResult.result); // Outputs a safety score between 0 (unsafe) and 10 (safe). -1 if there was an error, -2 if there are no checks remaining.

Development

Requires deno.

make format
make test

Publishing

After committing and pushing with a new version in deno.json, just run make publish.

Keywords

safelyx

FAQs

Package last updated on 02 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts