Full Code of MRokas/SmartDebug.JS for AI

master 22d3679079ab cached
3 files
4.0 KB
1.1k tokens
1 symbols
1 requests
Download .txt
Repository: MRokas/SmartDebug.JS
Branch: master
Commit: 22d3679079ab
Files: 3
Total size: 4.0 KB

Directory structure:
gitextract_p5mdxt1u/

├── .gitignore
├── README.md
└── smartdebug.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.png


================================================
FILE: README.md
================================================
# SmartDebug.JS
Next-generation debugging for javascript!

## Inspired by

Sadly, I do not know original author of image - but I would be more than glad to credit him for this awesome idea.

![Inspiration](https://github.com/MRokas/SmartDebug.JS/blob/master/Inspiration.jpg?raw=true)

## Getting started

First clone git:

```git clone http://github.com/MRokas/SmartDebug.JS.git```

And then include it by using your preferred method:

```<script src="js/smartdebug.js"></script> ```

```import SmartDebug from "js/smartdebug"; ```

```SmartDebug = require("js/smartdebug"); ```

## Usage

Basic usage using default settings:

    SmartDebug(function() { console.log(a); });
    // redirects to http://stackoverflow.com/search?q=[js] + a is not defined

Basic usage with redirecting to stackoverflow:

    SmartDebug({
        run: function() { console.log(a); }
    });
    // redirects to http://stackoverflow.com/search?q=[js] + a is not defined

If you prefer to use callback function, provide function or use ```true``` to use default function

    SmartDebug({
        run: function() { console.log(a); },
        callback: true
    });
    // Console output: http://stackoverflow.com/search?q=[js] + a is not defined

Using your own callback functions is just as simple:

    var errors = [];

    SmartDebug({
        run: function() { console.log(a); },
        callback: function (arg1) { errors.push(arg1); }
    });

    console.log(errors);
    // Console output: Array [ "http://stackoverflow.com/search?q=[js] + a is not defined" ]

If you prefer to always use same callback function, just set default one:

    var errors = [];
    SmartDebug.callback = function (arg1) { errors.push(arg1); };
    SmartDebug({
        run: function() { console.log(a); }
    });

    console.log(errors);
    // Console output: Array [ "http://stackoverflow.com/search?q=[js] + a is not defined" ]

And if stackoverflow isn't your prefered site to search for errors, provide it:

    SmartDebug({
        run: function() { console.log(a); },
        link: "https://www.google.com/search?q=javascript "
    });
    // redirects to https://www.google.com/search?q=javascript a is not defined

Or you can provide default one:

    var errors = [];

    SmartDebug.link = "https://www.google.com/search?q=javascript ";
    SmartDebug({
        run: function() { console.log(a); },
        callback: function (arg1) { errors.push(arg1); }
    });

    console.log(errors);
    // Console output: Array [ "https://www.google.com/search?q=javascript a is not defined" ]

## TODO

_Nothing - post issue or send PR!_

## DISCLAIMER

This is just a satire, enjoy.


================================================
FILE: smartdebug.js
================================================
// No Copyright 2016 https://github.com/MRokas
// Inspired by this imgur picture - http://i.imgur.com/3XvPstB.jpg
// Author unknown, I would be more than glad to credit him.
(function(name, definition) {
    if (typeof module != 'undefined') module.exports = definition();
    else if (typeof define == 'function' && typeof define.amd == 'object') define(definition);
    else this[name] = definition();
}('SmartDebug', function() {
    function SmartDebug(arg1) {
        var _run = typeof arg1 === 'object' && typeof arg1.run !== 'undefined' ? arg1.run : typeof arg1 === 'function' ? arg1 : undefined ;
        var _cb = typeof arg1 === 'object' && typeof arg1.callback !== 'undefined' ? arg1.callback : SmartDebug.callback;
        var _link = typeof arg1 === 'object' && typeof arg1.link !== 'undefined' ? arg1.link : SmartDebug.link;
        _cb = typeof _cb === 'boolean'
            ? _cb
                ? (SmartDebug.callback !== false ? SmartDebug.callback : console.log.bind(console))
                : false
            : typeof _cb === 'function'
                ? _cb
                : false;
        	try {
        		_run();
        	} catch(ex) {
        		_link += ex.message;
        		!_cb ? (window.location.href = _link) : (_cb(_link));
        	}
    }
    SmartDebug.callback = false;
    SmartDebug.link = "http://stackoverflow.com/search?q=[js] + ";
    return SmartDebug;
}));
Download .txt
gitextract_p5mdxt1u/

├── .gitignore
├── README.md
└── smartdebug.js
Download .txt
SYMBOL INDEX (1 symbols across 1 files)

FILE: smartdebug.js
  function SmartDebug (line 9) | function SmartDebug(arg1) {
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
  {
    "path": ".gitignore",
    "chars": 6,
    "preview": "*.png\n"
  },
  {
    "path": "README.md",
    "chars": 2654,
    "preview": "# SmartDebug.JS\nNext-generation debugging for javascript!\n\n## Inspired by\n\nSadly, I do not know original author of image"
  },
  {
    "path": "smartdebug.js",
    "chars": 1403,
    "preview": "// No Copyright 2016 https://github.com/MRokas\n// Inspired by this imgur picture - http://i.imgur.com/3XvPstB.jpg\n// Aut"
  }
]

About this extraction

This page contains the full source code of the MRokas/SmartDebug.JS GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (4.0 KB), approximately 1.1k tokens, and a symbol index with 1 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!