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

@wprimadi/lockdown

v1.0.0

Published

LOCKDOWN (Log Obfuscation & Console Kill-switch with Devtools Override Warning Network) - Lightweight JavaScript library to secure your website by blocking DevTools access, disabling context menu, shortcuts, text copy/cut/select, and more. Built for front

Readme

LOCKDOWN 🛡️

Log Obfuscation & Console Kill-switch with Devtools Override Warning Network

License Quality Gate BARRICADE CDN npm version npm downloads

LOCKDOWN is a lightweight JavaScript library designed to protect your website from unwanted user interactions such as opening DevTools, copying text, right-clicking, and more. This library helps you add an extra layer of front-end security in just a few lines of code.


✨ Features

  • 🔒 Detect and block browser DevTools
  • 🖱️ Disable right-click (context menu)
  • 🧠 Block keyboard shortcuts like F12, Ctrl+Shift+I, Ctrl+U, etc.
  • 📋 Prevent text copy and cut
  • ❌ Disable text selection
  • 🚫 Block mouse down actions
  • 🔄 Optional redirect when DevTools is detected

🚀 Getting Started

1. Install

You can include it directly in your HTML file:

<script src="lockdown.js"></script>

Or serve it via NPM/CDN:

CDN

You can include B.A.R.R.I.C.A.D.E from a CDN:

<script src="https://cdn.jsdelivr.net/gh/wprimadi/[email protected]/lockdown.min.js"></script>

Or the latest version:

<script src="https://cdn.jsdelivr.net/gh/wprimadi/lockdown/lockdown.min.js"></script>

NPM

Install via NPM:

npm install @wprimadi/lockdown

Or use it from the CDN NPM package:

<script src="https://cdn.jsdelivr.net/npm/@wprimadi/lockdown/lockdown.min.js"></script>

For more details, visit the NPM page.

2. Initialize

window.addEventListener('DOMContentLoaded', () => {
    lockdown.init({
        redirectUrl: '/access_denied',       // URL to redirect when DevTools is opened
        disableContextMenu: true,            // Default: true
        disableShorcuts: true,               // Default: true
        disableTextCopy: true,               // Default: true
        disableTextCut: true,                // Default: true
        disableTextSelection: true,          // Default: true
        disableMouseDown: true,              // Default: true
        disableDevTools: true                // Default: true
    });
});

All options are optional. If omitted, they will use the default values.


⚙️ Configuration Options

| Option | Type | Default | Description | |------------------------|----------|---------------|--------------------------------------------------------------------------| | redirectUrl | string | empty string | URL to redirect when DevTools is detected. Leave empty to skip redirect. | | disableContextMenu | bool | true | Disable right-click menu. | | disableShorcuts | bool | true | Block developer tool-related keyboard shortcuts. | | disableTextCopy | bool | true | Prevent users from copying text. | | disableTextCut | bool | true | Prevent users from cutting text. | | disableTextSelection | bool | true | Disable text selection on the page. | | disableMouseDown | bool | true | Disable mouse down interaction. | | disableDevTools | bool | true | Enable/disable DevTools detection mechanism. |


🔐 Use Case

LOCKDOWN is perfect for:

  • Web-based quizzes or assessments
  • SaaS dashboards with sensitive UI elements
  • Public landing pages where copying or debugging is discouraged
  • Frontend-only applications requiring extra client-side security

🌐 Compatibility

LOCKDOWN has been tested and verified on the following browsers:

Chrome Edge Firefox Opera


⚠️ Disclaimer

This library only provides basic obfuscation and deterrence. It is not a foolproof security solution and should be used alongside proper backend validation and security best practices.


📄 License

MIT License © 2025 Wahyu Primadi