console-related-shortcuts
v1.0.3
Published
shortcuts for console related things
Maintainers
Readme
console-shorthand
Tiny utility library that gives you clean, short aliases for common console methods.
Stop typing console.log everywhere — write faster, cleaner logs ⚡
Features
- Short aliases for common console methods
- Easy to remember
- Lightweight (zero dependencies)
- Works in Node.js (ES Modules)
Installation
npm install console-shorthandUsage
import { cl, cw, ce, ct, cd } from "console-shorthand";
// log
cl("Hello world");
// warning
cw("Warning message");
// error
ce("Something went wrong");
// table
ct([{ name: "Alice", age: 20 }]);
// inspect object
cd({ deep: { nested: { value: 42 } } });Basic Logging
cl(...args); // console.log
ci(...args); // console.info
cw(...args); // console.warn
ce(...args); // console.error
cdg(...args); // console.debugStructured Output
ct(data); // console.table
cd(obj); // console.dir (with depth + colors)Timing
ctg(label); // console.time
cte(label); // console.timeEndCounting
cc(label); // console.count
ccr(label); // console.countResetGrouping
cg(label); // console.group
cge(); // console.groupEndUtilities
clr(); // console.clear
ca(condition, ...args); // console.assert
ctr(...args); // console.traceExample
import { cl, ctg, cte } from "console-shorthand";
ctg("process");
cl("Starting...");
for (let i = 0; i < 1000000; i++) {}
cte("process");Why use this?
Instead of:
console.log("data");
console.error("error");
console.warn("warning");Write:
cl("data");
ce("error");
cw("warning");Cleaner, faster, and easier to read.
Notes
- Designed for development convenience
- Not intended to replace full logging libraries in production
