Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@codebite/logger
Advanced tools
A simple log utility for node which uses process stdout write instead of console.
A small and fast node.js library to create a log that doesn't hurt the eyes!
trace
, debug
, info
, warn
& error
Syntax coloring
(simple and intuitive)filename
, line number
and column
function calls
or tagged templates
npm i @codebite/logger
One can log using function calls
const log = require("@codebite/logger");
log("Hello world!")
or tagged templates
log`Hello world!`
In both cases instead of a generic log one can use a specific level
const {trace, debug, info, warn, error, setLevel} = require("@codebite/logger");
setLevel("trace"); // otherwise defaults to "info"
trace`Hello world!`
debug`Hello world!`
info`Hello world!`
warn`Hello world!`
error`Hello world!`
produces the following output (indicatively):
The following example enables the details and uses method calls as an alternative to function calls
1 | const log = require("@codebite/logger");
2 |
3 | log.level = "trace";
4 |
5 | log.details = true;
6 |
7 | log.trace("Hello world!");
8 | log.debug("Hello world!");
9 | log.info("Hello world!");
10 | log.warn("Hello world!");
11 | log.error("Hello world!");
producing an output similar to this:
console.log x 1,494 ops/sec ±0.91% (81 runs sampled)
simple x 1,426 ops/sec ±1.01% (88 runs sampled)
tagged templates x 1,487 ops/sec ±1.22% (86 runs sampled)
detailed x 1,362 ops/sec ±0.83% (84 runs sampled)
detailed tagged templates x 1,420 ops/sec ±0.85% (86 runs sampled)
Oddly, it seems that tagged templates are faster ...but not by much.
The log library is practically as fast as console.log and the impact of enabling the details negligible in comparison to the cost of the write operations
FAQs
A simple log utility for node which uses process stdout write instead of console.
We found that @codebite/logger 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.