
Security News
Re-Enabled GitHub Actions Expose Thousands of Repositories to Mini Shai-Hulud
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.
@sylphx/cat
Advanced tools
The fastest, lightest, and most extensible logger for all JavaScript runtimes.
bun add @sylphx/cat
npm install @sylphx/cat
import { createLogger, consoleTransport, prettyFormatter } from '@sylphx/cat'
const logger = createLogger({
level: 'info',
formatter: prettyFormatter(),
transports: [consoleTransport()]
})
logger.info('Hello world!', { user: 'kyle' })
logger.error('Something went wrong', { error: 'ECONNREFUSED' })
import { createLogger } from '@sylphx/cat'
const logger = createLogger()
logger.trace('Trace message')
logger.debug('Debug message')
logger.info('Info message')
logger.warn('Warning message')
logger.error('Error message')
logger.fatal('Fatal message')
logger.info('User action', {
userId: 'user123',
action: 'login',
timestamp: Date.now()
})
const logger = createLogger({ context: { app: 'my-app' } })
const authLogger = logger.child({ service: 'auth' })
authLogger.info('User logged in', { userId: 'user123' })
// Logs include both app and service context
import {
createLogger,
consoleTransport,
fileTransport,
jsonFormatter
} from '@sylphx/cat'
const logger = createLogger({
formatter: jsonFormatter(),
transports: [
consoleTransport(),
fileTransport({ path: './logs/app.log' })
]
})
import { createLogger } from '@sylphx/cat'
import type { Formatter, LogEntry } from '@sylphx/cat'
class CustomFormatter implements Formatter {
format(entry: LogEntry): string {
return `[${entry.level}] ${entry.message}`
}
}
const logger = createLogger({
formatter: new CustomFormatter()
})
import {
createLogger,
contextPlugin,
samplingPlugin
} from '@sylphx/cat'
const logger = createLogger({
plugins: [
// Add context to all logs
contextPlugin({
app: 'my-app',
version: '1.0.0'
}),
// Sample 10% of logs (always log errors)
samplingPlugin(0.1)
]
})
const logger = createLogger({
batch: true,
batchSize: 100, // Flush after 100 logs
batchInterval: 1000 // Or every 1 second
})
// Logs are batched for efficiency
for (let i = 0; i < 10000; i++) {
logger.info(`Event ${i}`)
}
await logger.flush() // Manual flush
import { jsonFormatter } from '@sylphx/cat'
const logger = createLogger({
formatter: jsonFormatter()
})
// Output: {"level":"info","time":1234567890,"msg":"Hello","data":{"key":"value"}}
import { prettyFormatter } from '@sylphx/cat'
const logger = createLogger({
formatter: prettyFormatter({
colors: true,
timestamp: true,
timestampFormat: 'iso' // 'iso' | 'unix' | 'relative'
})
})
// Output: 2024-01-01T12:00:00.000Z INF Hello {"key":"value"}
import { consoleTransport } from '@sylphx/cat'
const logger = createLogger({
transports: [consoleTransport()]
})
import { fileTransport } from '@sylphx/cat'
const logger = createLogger({
transports: [
fileTransport({
path: './logs/app.log'
})
]
})
import { streamTransport } from '@sylphx/cat'
const logger = createLogger({
transports: [
streamTransport({
stream: process.stdout
})
]
})
import type { Transport, LogEntry } from '@sylphx/cat'
class HttpTransport implements Transport {
async log(entry: LogEntry, formatted: string): Promise<void> {
await fetch('https://logs.example.com', {
method: 'POST',
body: formatted
})
}
}
const logger = createLogger({
transports: [new HttpTransport()]
})
Adds static context to all log entries:
import { contextPlugin } from '@sylphx/cat'
const logger = createLogger({
plugins: [
contextPlugin({
env: 'production',
region: 'us-east-1'
})
]
})
Reduces log volume by sampling:
import { samplingPlugin } from '@sylphx/cat'
const logger = createLogger({
plugins: [
samplingPlugin(0.1) // Log 10% of debug/info, always log errors
]
})
import type { Plugin, LogEntry } from '@sylphx/cat'
const redactPlugin: Plugin = {
name: 'redact',
onLog(entry: LogEntry): LogEntry {
// Redact sensitive data
if (entry.data?.password) {
return {
...entry,
data: {
...entry.data,
password: '[REDACTED]'
}
}
}
return entry
}
}
const logger = createLogger({
plugins: [redactPlugin]
})
Benchmarks on Apple M1 Pro:
baseline: empty function call 1,234,567,890 ops/sec
logger: filtered debug log (below threshold) 234,567,890 ops/sec
logger: basic info log (noop transport) 45,678,901 ops/sec
logger: info with data (noop transport) 34,567,890 ops/sec
Key optimizations:
createLogger(options?)Create a new logger instance.
Options:
level?: LogLevel - Minimum log level (default: 'info')formatter?: Formatter - Log formattertransports?: Transport[] - Output transportsplugins?: Plugin[] - Middleware pluginscontext?: Record<string, unknown> - Static contextbatch?: boolean - Enable batching (default: false)batchSize?: number - Batch size (default: 100)batchInterval?: number - Batch interval in ms (default: 1000)trace(message, data?) - Log at trace leveldebug(message, data?) - Log at debug levelinfo(message, data?) - Log at info levelwarn(message, data?) - Log at warn levelerror(message, data?) - Log at error levelfatal(message, data?) - Log at fatal levellog(level, message, data?) - Log at specific levelsetLevel(level) - Change minimum log levelchild(context) - Create child logger with additional contextflush() - Flush pending logsclose() - Close logger and cleanup resourcesExisting loggers are either:
@sylphx/cat solves all of these:
MIT © Kyle Zhu
Contributions welcome! Please read our contributing guidelines first.
FAQs
The fastest, lightest, most extensible logger for all JavaScript runtimes
The npm package @sylphx/cat receives a total of 3 weekly downloads. As such, @sylphx/cat popularity was classified as not popular.
We found that @sylphx/cat demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.

Research
/Security News
The compromise affects MemTensor's MemOS, an open source memory framework for large language models (LLMs) and AI agents. Both npm package @memtensor/memos-cloud-openclaw-plugin and the PyPI package MemoryOS are compromised. They drop cross-platform Go binaries that exfiltrate developer secrets.