
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@deinstapel/tldr
Advanced tools
TLDR is a logging library driven by and designed for TypeScript. It follows the design and functionality of logrus. TLDR implements structured logging, which means that you can pass structured contexts into the library and evaluate them using a LMS lateron.
The example below is intended to be run in node, if you'd like to run it in the browser change NodeConsoleBackend
to BrowserConsoleBackend
.
/**
* First of all, import all required classes and variables.
* You need to import the logger as well as at least one backend.
*/
import { NodeConsoleBackend, Logger } from '@deinstapel/tldr';
/**
* ConfigureInstance should be called **exactly** once.
* Without configureInstance, all log messages will be dropped.
* You might add global metadata here, for example your apps version
* or a unique session ID for a specific app startup
*/
Logger.configureInstance({
globalContext: { session: Math.round(Math.random() * 10000000) },
backends: [new NodeConsoleBackend({
color: true,
formatting: 'human', // Can also be JSON
})],
});
/**
* Create a child logger with fields and log an info message
*/
Logger.withFields({
var: 'foo',
var2: 'bar',
answer: 42,
}).info('hello, world');
/**
* Annotate a single field and log a message with custom log level
*/
Logger.withField('answer', 42).log('customlevel', 'custom message')
FAQs
TypeScript Logging Library
The npm package @deinstapel/tldr receives a total of 3 weekly downloads. As such, @deinstapel/tldr popularity was classified as not popular.
We found that @deinstapel/tldr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.