
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
console-blame
Advanced tools
It highlights and helps to find forgotten console.log calls in runtime
It highlights and helps to find forgotten console.log calls in runtime. Live example
console-blame
can be installed using npm
:
npm install console-blame --save-dev
ConsoleBlame(Object consoleObject, String[] trapsList)
ConsoleBlame(Object consoleObject)
ConsoleBlame(String[] trapsList)
ConsoleBlame()
ConsoleBlame#configure(Object options)
see Configuration options
ConsoleBlame#restore()
releases all trapped methodsConsoleBlame#trap(String[] ...methods)
traps all listed methodsConsoleBlame#trap()
traps all available methodsCan be configured, using require('console-blame').configure({ ... })
pathFormat
format of file name, line and column. default: '%s:%d:%d'
lineFormat
format of code line. default: '%d | %s'
contextSize
number of lines before and after target line. default: 3
sources
print source code? default: true
Trap all methods of console
require('console-blame')();
console.log(123); // Will print debug message
console.error(123); // Will print debug message
Trap only console.log
require('console-blame')(['log']);
console.log(123); // Will print debug message
Trap only log and error of specific console object
require('console-blame')(console, ['log', 'error']);
console.log(123); // Will print debug message
Trap all methods and change size of context and line format
require('console-blame')().configure({
contextSize: 5,
lineFormat: '%d\t%s'
});
console.log(123);
Restore traps
var blame = require('console-blame')();
console.log(123); // Will print debug message
blame.restore();
console.log(123); // Will NOT print debug message
blame.trap();
console.log(123); // Will print debug message
A log message
/home/username/projects/console-blame/lib/index.js:174:9
169 | attachTrapsTo(console).configure({
170 | contextSize: 5,
171 | lineFormat: '%d\t%s'
172 | });
173 |
174 | console.log('A log message'); // <<< This line will be highlighted
175 |
FAQs
It highlights and helps to find forgotten console.log calls in runtime
The npm package console-blame receives a total of 7 weekly downloads. As such, console-blame popularity was classified as not popular.
We found that console-blame demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.