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 🙏

© 2025 – Pkg Stats / Ryan Hefner

link-shield

v1.0.0

Published

Link Shield is a lightweight cybersecurity-focused npm package that detects suspicious and malicious URLs using heuristics, fuzzy matching, and threat intelligence patterns.

Downloads

3,944

Readme

📦 Link Shield

Link Shield is a lightweight cybersecurity-focused npm package that detects suspicious and malicious URLs using heuristics, fuzzy matching, and threat intelligence patterns. It helps developers, security teams, and applications identify phishing attempts, typosquatting domains, dangerous downloads, obfuscated IPs, suspicious TLDs, and other link-based threats.


🛡️ Why Cybersecurity Teams Need This

More than 90% of cyberattacks start with a malicious link — whether in phishing emails, social engineering messages, or compromised websites. Attackers commonly use:

  • Typosquatting domains (paypa1.com, g00gle.net)
  • Free hosting/CDNs (Firebase, Dropbox, GitHub raw)
  • Obfuscation tricks (punycode, encoded IPs, double extensions)
  • Dangerous downloads (.exe, .apk, .scr)

Link Shield provides a simple way to detect and score these threats automatically. It can be integrated into:

  • 📨 Email security filters (detect phishing links in inbound emails)
  • 🌐 Web applications (protect users from malicious redirects)
  • 🔍 Threat intelligence pipelines (scan large volumes of URLs)
  • 🧑‍💻 DevSecOps tooling (validate links in CI/CD or monitoring scripts)

🚀 Features

  • ✅ Detects phishing & typosquatting with fuzzy matching
  • ✅ Identifies malicious protocols (javascript:, data:, file:)
  • ✅ Flags suspicious TLDs (.xyz, .tk, .ru)
  • ✅ Catches obfuscation tricks (punycode, Unicode homoglyphs, hex IPs)
  • ✅ Detects dangerous downloads (.exe, .apk, .scr)
  • ✅ Warns on free hosting/CDN abuse (Dropbox, Firebase, GitHub raw, IPFS)
  • ✅ Provides a risk score (0–100) with reasons for transparency

📦 Installation

npm install link-shield

or using yarn:

yarn add link-shield

⚡ Usage

const { detectSuspiciousLink } = require("link-shield");

const result = detectSuspiciousLink("http://g00gle.com/login");

console.log(result);

Example Output

{
  "url": "http://g00gle.com/login",
  "suspicious": true,
  "riskScore": 60,
  "reasons": [
    "Domain contains numbers (possible typosquatting)",
    "Lookalike domain detected: g00gle ≈ google",
    "Suspicious keyword in domain"
  ]
}

⚙️ API

detectSuspiciousLink(url, options)

  • url (string, required) → The URL to analyze

  • options (object, optional)

    • threshold (number, default: 20) → Minimum score to mark as suspicious

Returns:

{
  url: string;
  suspicious: boolean;
  riskScore: number; // 0–100
  reasons: string[];
}

🔐 Cybersecurity Use Cases

  • Email Security → Filter malicious links in phishing campaigns
  • Web Security → Block suspicious redirects or downloads before execution
  • Threat Intelligence → Enrich suspicious indicators (IOCs) with scoring
  • SOC Tools → Automate link triage in incident response
  • CI/CD Security → Validate external links in codebases or docs

🧪 Testing

We use Jest for testing. Run tests with:

npm test

Example test case (test/detector.test.js):

const { detectSuspiciousLink } = require("../src");

test("flags g00gle.com as suspicious", () => {
  const result = detectSuspiciousLink("http://g00gle.com/login");
  expect(result.suspicious).toBe(true);
  expect(result.riskScore).toBeGreaterThan(20);
});

🔮 Roadmap

  • [ ] CLI support (npx link-shield <url>)
  • [ ] Configurable rule sets (enable/disable rules)
  • [ ] Integration with threat intelligence feeds
  • [ ] Browser extension integration
  • [ ] Machine-learning powered URL classification