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 🙏

© 2024 – Pkg Stats / Ryan Hefner

developer-tools-detector

v1.0.0

Published

Easily detect and block developer tools on any web server.

Downloads

30

Maintainers

lazyfenixlazyfenix

Keywords

dev-tools-detectordev-tools-blockdeveloper-tools-detectordeveloper-tools-blockdev-tools-protectiondev-tools-guarddevtools-detectordeveloper-tools-securitydetect-developer-toolsdetect-dev-toolsbrowser-devtools-detectornpm-devtools-detectornpm-package-securitydevtools-securitybrowser-tools-detectiondevtools-preventionconsole-logger-securitydevtools-debugger-detectorlazyfenixDTDdebugger-detectornpmjs-security-toolsnpm-security-packagenpm-console-loggernpmjs-detection-toolsnpmjs-securityjavascript-security-toolstypescript-devtoolsjavascript-detectortypescript-securitynpm-package-protectionnpmjs-debuggernpmjs-package-managernpm-package-scriptsjs-securitynpm-protect-packagenpm-anti-debuggerdeveloper-tools-detectionbrowser-securityblock-developer-toolsbrowser-devtoolsprevent-devtoolsdetect-devtoolssecure-web-appbrowser-debugger-detectorbrowser-console-securitydevtools-warningbrowser-console-protectionconsole-warningsdisable-inspect-elementsecure-webpageprevent-consoleweb-app-debuggerjavascript-console-logsdetect-debuggerconsole-logs-protectiondisable-debuggerblock-consoledebugger-warningsconsole-protectiondetect-js-debuggerconsole-log-detectorjs-debugger-detectionconsole-warning-scriptjavascript-debuggerjavascript-prevent-devtoolsdetect-inspect-elementblock-inspect-elementdisable-inspectprevent-unauthorized-accessweb-security-toolsjavascript-web-securityprevent-hackingbrowser-security-toolssecure-js-codesecure-typescriptdetecting-debuggingwebpage-securityanti-inspect-toolssecure-javascriptblock-debuggingjavascript-devtools-prevention

Readme

npm install developer-tools-detector
yarn add developer-tools-detector
  • consoleLog: true or false

  • checkDuration: "Always" or Number in miliseconds

  • blockIfDetected: true or false

  • allowedPaths: list of paths

  • consoleLog - This option will log detection if enabled.

  • checkDuration - Set if you want to check for devtools always or only if first X ms time of user access on website.

  • blockIfDetected - Do you want to block (about:blank) user that will open devtools?

  • allowedPaths - What paths you want to have developer-tools-detection enabled on?

const express = require('express');
const { DevToolsDetector } = require('developer-tools-detector'); 

const app = express();
const port = 3000;

const allowedPaths = ['/protected'];

const detector = new DevToolsDetector(allowedPaths, {
    consoleLog: true,
    checkDuration: "always",
    blockIfDetected: false, 
});

app.post('/log-devtools-detected', (req, res) => {
    console.log("Developer tools detected on the client!");
    res.sendStatus(200);
});

app.get('/protected', (req, res) => {
    if (detector.isPathAllowed(req.path)) {
        const detectionScript = detector.getDetectionScript();

        res.send(`
            <html>
                <head>
                    <title>Protected Route</title>
                    ${detectionScript} <!-- Injects the DevTools detection script -->
                </head>
                <body>
                    <h1>This is a protected route!</h1>
                    <p>Your protected content goes here...</p>
                </body>
            </html>
        `);
    } else {
        res.status(403).send("Access Denied");
    }
});

app.get('/', (req, res) => {
    res.send('Hello World!');
});

app.listen(port, () => {
    console.log(`Server is running at http://localhost:${port}`);
});
Server is running at http://localhost:3000
Developer tools detected on the client!

If you have any issues don't hesitate to report it via GitHub Issues.

This package was made by @lazyfenix.