
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
ausgabe
is designed to output user relevant log messages to the console or to a custom stream. It's lightweight, customizable and perfect for tools that need simple, yet beautiful log messages.
npm install ausgabe
import { createLogger } from 'ausgabe'
const instance = createLogger({
info: {
color: 'blue',
badge: 'ℹ',
label: 'info',
},
})
instance.info('Hello world')
import figures from 'figures'
import { createLogger } from 'ausgabe'
const instance = createLogger(
{
info: {
color: 'blue',
badge: figures.info,
label: 'info',
},
warn: {
color: 'yellow',
badge: figures.warning,
label: 'warn',
stack: false,
},
error: {
color: 'red',
badge: figures.cross,
label: 'error',
},
},
{
indention: 7,
}
)
instance.info('Hello world')
instance.info('%s %s', 'Hello', 'world')
instance.warn(new Error('Logs error without the stack'))
instance.error(new Error('Logs error with the stack'))
ausgabe
supports nested logger instances.
import { createLogger } from 'ausgabe'
const instance = createLogger({
requests: createLogger({
get: {
color: 'magenta',
badge: '↗',
label: 'get',
},
post: {
color: 'magenta',
badge: '↗',
label: 'post',
},
}),
})
instance.requests.get('http://example.com')
instance.requests.post('http://example.com')
ausgabe
streams to process.stdout
by default, but also allows custom writable streams.
import { Writable } from 'node:stream'
import { createLogger } from 'ausgabe'
const stream = new Writable({
write: (chunk, encoding, callback) => {
console.log(chunk.toString())
callback()
},
})
const instance = createLogger({
info: {
color: 'blue',
badge: 'ℹ',
label: 'info',
streams: [stream],
},
})
instance.info('Hello world')
import { createLogger } from 'ausgabe'
const instance = createLogger({
info: {
color: 'blue',
badge: 'ℹ',
label: 'info',
},
})
import { createLogger } from 'ausgabe'
const instance = createLogger(
{
info: {
color: 'blue',
badge: 'ℹ',
label: 'info',
},
},
{
indention: 6,
}
)
types
{Object}
Methods of the logger.
color
{?String}
Color of the log. Must be supported by chalk. Defaults to blue
.badge
{?String}
Icon to log along with the message. Using figures is recommended. Defaults to ℹ
.label
{?String}
Label to log along with the message. Defaults to info
.stack
{?Boolean}
Determines if the stack of an error should be logged. Defaults to true
.streams
{?Array}
Writable streams to which the data is written. Defaults to [process.stdout]
.options
{?Object}
Options.
indention
{?Integer}
Aligns log messages with a custom indention.{Function}({String},{?...*})
ausgabe instance.instance.info('Hello world')
instance.info('%s %s', 'Hello', 'world')
message
{String}
Message containing zero or more substitution strings.substitutions
{?...*}
Data with which to replace substitution strings within message
.I am working hard on continuously developing and maintaining my projects. Please consider making a donation to keep the project going strong and me motivated.
[1.0.0] - 2023-04-01
streams
optionFAQs
Tiny logger with zero defaults
The npm package ausgabe receives a total of 13 weekly downloads. As such, ausgabe popularity was classified as not popular.
We found that ausgabe 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.