npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@logone/adapter-file

v1.1.0

Published

File adapter for Logone

Readme

@logone/adapter-file

A Logone adapter for outputting logs to files with rotation capabilities.

Features

  • File log output with JSON format
  • File rotation (size-based and time-based)
  • Customizable output format
  • Multiple encoding support
  • Timestamp-based file naming

Installation

npm install @logone/adapter-file

Usage

Basic Usage

import { createAdapter } from '@logone/adapter-file'
import { createLogger } from '@logone/core'

const adapter = createAdapter({
  filepath: './logs/app.log'
})

const logger = createLogger({
  adapters: adapter
})

logger.info('Hello, world!')

File Rotation

Size-based Rotation

const adapter = createAdapter({
  filepath: './logs/app.log',
  maxFileSize: 10 * 1024 * 1024, // 10MB
  rotateFileCount: 5 // app.log, app.1.log, app.2.log, app.3.log, app.4.log
})

Time-based Rotation

// Daily rotation
const dailyAdapter = createAdapter({
  filepath: './logs/app.log',
  rotationFrequency: 'daily',
  timestampFormat: 'YYYY-MM-DD' // app.2024-01-15.log
})

// Hourly rotation
const hourlyAdapter = createAdapter({
  filepath: './logs/app.log',
  rotationFrequency: 'hourly',
  timestampFormat: 'YYYY-MM-DD_HH' // app.2024-01-15_14.log
})

// Minutely rotation
const minutelyAdapter = createAdapter({
  filepath: './logs/app.log',
  rotationFrequency: 'minutely',
  timestampFormat: 'YYYY-MM-DD_HH-mm' // app.2024-01-15_14-30.log
})

Configuration Options

const adapter = createAdapter({
  filepath: './logs/app.log',
  maxFileSize: 5 * 1024 * 1024, // 5MB
  rotateFileCount: 3,
  append: true, // Append to file (default: true)
  encoding: 'utf-8' // File encoding (default: 'utf-8')
})

API

FileAdapterOptions

| Property | Type | Default | Description | |----------|------|---------|-------------| | filepath | string | - | Output file path (required) | | maxFileSize | number | Infinity | Maximum file size in bytes | | rotateFileCount | number | 5 | Number of rotation files to keep | | append | boolean | true | Whether to append to existing file | | encoding | BufferEncoding | 'utf-8' | File encoding | | rotationFrequency | 'daily' \| 'hourly' \| 'minutely' | undefined | Time-based rotation frequency | | timestampFormat | string | 'YYYY-MM-DD' | Timestamp format pattern |

Rotation Strategies

Size-based Rotation

When maxFileSize is specified, files are automatically rotated when they exceed the specified size.

Example: When app.log reaches 5MB:

  • app.log → renamed to app.1.log
  • New app.log is created

Use rotateFileCount to specify the number of files to keep. Older files are automatically deleted.

Time-based Rotation

When rotationFrequency is specified, new files are created at specified intervals:

  • daily: Daily rotation (new file when date changes)
  • hourly: Hourly rotation (new file when hour changes)
  • minutely: Minutely rotation (new file when minute changes)

Timestamp Format

Available format tokens for time-based rotation:

  • YYYY: Year (4 digits)
  • MM: Month (2 digits, zero-padded)
  • DD: Day (2 digits, zero-padded)
  • HH: Hour (2 digits, zero-padded, 24-hour format)
  • mm: Minute (2 digits, zero-padded)
  • ss: Second (2 digits, zero-padded)