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

@trap_stevo/devlock

v0.0.8

Published

Protect modern web applications from inspection, tampering, and unauthorized access through real-time detection, checksum enforcement, and customizable response strategies. Monitor developer tools, block key combinations, freeze console output, and enforc

Downloads

45

Readme

🛡️ DevLock

The Guardian of Frontend Integrity

A powerful real-time defense system that detects devtools, locks down source visibility, and executes fully customizable countermeasures against inspection and tampering.


🚀 Features

  • Real-time detection of Developer Tools (DevTools)
  • Runtime checksum verification (fixed or dynamic)
  • Custom violation response methods:
    • Overlay lockout
    • Console freezing
    • Redirects or replacement
    • DOM blanking
    • Session and localStorage lockdown
  • Full customization with callbacks and overlays
  • Dev mode toggle for safe development
  • Lightweight and framework-agnostic

📦 Installation

npm install @trap_stevo/devlock

🔧 Usage

import { DevLock } from "@trap_stevo/devlock";

const devLock = new DevLock({
     freezeConsole : true,
     verifyChecksum : true,
     checksumMode : "dynamic",
     redirectURL : "/unauthorized",
     violationMethod : "overlay,external",
     overlayMessage : "⚠️ Unauthorized action detected.",
     onDevToolsOpen : () => console.warn("DevTools access blocked."),
     onViolation : (status) => console.log("Violation triggered:", status)
});

devLock.start();

🧠 Violation Methods

| Method | Description | |----------------|--------------------------------------------| | redirect | Navigate to a specified URL | | replace | Replace the page with about:blank | | blank | Wipe the DOM contents | | close | Attempt to close the window | | overlay | Show a full-screen warning overlay | | external | Redirect to browser homepage or URL | | lockStorage | Block access to localStorage/sessionStorage |

Multiple methods may be combined: "overlay,external"


🧪 Checksum Modes

  • fixed — compare script hashes against provided list
  • dynamic — remember initial hashes per session and alert on changes
expectedChecksums : {
     "https://yourdomain.com/js/app.js" : "abc123..."
}

✨ Overlay Customization

overlayMessage : "Access denied. Contact administrator.",
overlayConfigurationSettings : {
     background : "#1A1A1A",
     color : "#FF4444",
     fontSize : "28px"
},
overlayNode : "<div style='...'>Custom HTML content</div>"

📘 API Specification

Public Methods

| Method | Description | |--------------------------------|------------------------------------------------------------------------------| | start() | Activates detection and begins monitoring for violations. | | stop() | Deactivates monitoring and restores modified behaviors. | | status() | Returns an object containing the current lock status. | | checkNow() | Forces an immediate check for DevTools. | | runViolationMethods(string) | Manually runs one or more violation actions (e.g., "overlay,blank"). |

Configuration Options

| Option | Type | Description | |-------------------------------|---------------------------|-----------------------------------------------------------------------------| | devMode | boolean | Enables or disables detection during development. | | redirectURL | string | Target URL for redirection. | | violationMethod | string | Comma-separated list of response methods. | | freezeConsole | boolean | Disables console output methods. | | verifyChecksum | boolean | Enables runtime checksum verification. | | checksumMode | "fixed" \| "dynamic" | Determines if static or dynamic checksums are enforced. | | expectedChecksums | object | Map of script URLs to expected hashes. | | overlayMessage | string | Message shown in the default overlay. | | overlayConfigurationSettings| object | CSS styles for the overlay. | | overlayNode | HTMLElement \| string | Custom node or markup to override default overlay. | | onDevToolsOpen | function | Callback triggered when DevTools opens. | | onDevToolsClosed | function | Callback triggered when DevTools closes. | | onViolation | function | Callback triggered before violation methods execute. | | onRightClick | function | Callback for right-click blocking. | | onBlockedShortcut | function | Callback for blocked key combinations. | | onBeforePrint | function | Callback for beforeprint interception. | | onDragStart | function | Callback for drag start prevention. |


✨ License

See License in LICENSE.md