├── .editorconfig ├── .gitignore ├── README.md ├── browser.js ├── example ├── index.html └── server.js ├── index.js ├── package.json └── server.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.json] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | *.log 4 | *.map 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dumbugger 2 | 3 | > Full-stack javascript debugger for smart people. 👻 4 | > 5 | > Dumbugger opens your browser tab with google query with error stack info everytime when your code throws exception. 6 | 7 | 8 | 9 | ## Install 10 | 11 | ```bash 12 | npm install dumbugger --save 13 | ``` 14 | 15 | ## Usage 16 | 17 | Include _dumbugger_ script before any of your application code. 18 | 19 | ### Node.js 20 | 21 | ```js 22 | require('dumbugger/server'); // for server side 23 | ``` 24 | 25 | or 26 | 27 | ```js 28 | require('dumbugger/browser'); // for npm powered bundles 29 | ``` 30 | 31 | ### Browser 32 | 33 | ```html 34 | 35 | ``` 36 | 37 | --- 38 | 39 | **MIT Licensed** 40 | 41 | -------------------------------------------------------------------------------- /browser.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | window.onerror = function (message, file, line, col, error) { 3 | var win = window.open('https://www.google.com/#q=' + encodeURIComponent(message), '_blank'); 4 | win.focus(); 5 | }; 6 | })(); 7 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dumbugger Demo 5 | 11 | 12 | 13 |

DUMBUGGER DEMO

14 |
Error will be thrown in: 5 seconds
15 | 16 | 17 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/server.js: -------------------------------------------------------------------------------- 1 | require('../server'); 2 | 3 | setTimeout(function () { 4 | throw new TypeError('Oooops! On server...'); 5 | }, 3000); 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | browser: require('./browser'), 3 | server: require('./server') 4 | }; 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dumbugger", 3 | "version": "0.1.0", 4 | "description": "Full-stack javascript debugger for smart people.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": ["debug", "browser", "server", "debugger", "alert"], 10 | "author": "Dmitri Voronianski ", 11 | "license": "MIT", 12 | "dependencies": { 13 | "opener": "^1.4.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var opener = require('opener'); 2 | process.on('uncaughtException', function (err) { 3 | var url = 'https://www.google.com/#q=' + encodeURIComponent(err); 4 | opener(url); 5 | }); 6 | --------------------------------------------------------------------------------