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

@rabby-wallet/rabby-logger

v0.3.0

Published

Rabby log parser and platform-agnostic logger core with rolling zip writer

Downloads

361

Readme

@rabby-wallet/rabby-logger

Platform-agnostic Rabby log parsing and writing primitives.

This package provides:

  • parsing for Rabby .log files and exported .zip archives
  • @rabby-log/v1 line formatting
  • a generic rolling zip writer
  • a generic logger core

It does not ship platform-specific storage or lifecycle adapters.

Install

npm install @rabby-wallet/rabby-logger

Parse logs

import {
  mergeParsedLogInputs,
  parseRabbyLogInputBytes,
} from "@rabby-wallet/rabby-logger";

const inputs = await Promise.all(
  files.map(async (file) =>
    parseRabbyLogInputBytes(file.name, await file.arrayBuffer()),
  ),
);

const dataset = mergeParsedLogInputs(inputs);
console.log(dataset.records[0]?.message);

Write logs

Most hosts should not implement a new writer from scratch.

Recommended path:

  1. implement LoggingFileSystemAdapter
  2. use the built-in RollingZipLogWriter
  3. pass it to AppLogger
import {
  AppLogger,
  RollingZipLogWriter,
  type LoggingFileSystemAdapter,
} from "@rabby-wallet/rabby-logger";

const myFsAdapter: LoggingFileSystemAdapter = {
  mkdir: async (path) => {},
  readFile: async (path, encoding) => "...",
  writeFile: async (path, contents, encoding) => {},
  appendFile: async (path, contents, encoding) => {},
  moveFile: async (from, to) => {},
  listFiles: async (path) => [],
  unlink: async (path) => {},
};

const writer = new RollingZipLogWriter({
  fs: myFsAdapter,
  rootDir: "/applogs",
  archivePrefix: "rabby-mobile-logs",
});

const logger = new AppLogger({
  runtimeEnv: "production",
  platform: "ios",
  writer,
  shouldWriteToFile: () => true,
  shouldCaptureConsole: () => true,
});

logger.installConsoleCapture();
logger.info("app boot");
await logger.flush();
await logger.finalizeArchive();

Bring Your Own Writer

If your host already owns archive layout, rotation, or native zip writing, implement AppLogWriter instead of LoggingFileSystemAdapter.

import { AppLogger, type AppLogWriter } from "@rabby-wallet/rabby-logger";

class NativeArchiveWriter implements AppLogWriter {
  async writeLine(line: string) {
    await nativeLogger.appendUtf8Line(line);
  }

  async flush() {
    await nativeLogger.flush();
  }

  async finalizeArchive() {
    return nativeLogger.finalizeZip();
  }

  getState() {
    return {
      rootDir: "/native/applogs",
      activeArchivePath: nativeLogger.currentArchivePath(),
    };
  }
}

const logger = new AppLogger({
  runtimeEnv: "production",
  platform: "android",
  writer: new NativeArchiveWriter(),
  shouldWriteToFile: () => true,
});

React Native Example

This is the same integration shape used by Rabby Mobile: react-native-fs provides the file operations, while RollingZipLogWriter keeps ownership of formatting, entry rotation, and archive finalization.

import { Platform } from "react-native";
import RNFS from "react-native-fs";
import {
  AppLogger,
  RollingZipLogWriter,
  type LoggingFileSystemAdapter,
} from "@rabby-wallet/rabby-logger";

const rnfsLoggingAdapter: LoggingFileSystemAdapter = {
  mkdir(path) {
    return RNFS.mkdir(path, { NSURLIsExcludedFromBackupKey: true });
  },
  readFile(path, encoding) {
    return RNFS.readFile(path, encoding);
  },
  writeFile(path, contents, encoding) {
    return RNFS.writeFile(path, contents, encoding);
  },
  appendFile(path, contents, encoding) {
    return RNFS.appendFile(path, contents, encoding);
  },
  moveFile(from, to) {
    return RNFS.moveFile(from, to);
  },
  async listFiles(path) {
    const entries = await RNFS.readDir(path);
    return entries.filter(item => item.isFile()).map(item => ({
      name: item.name,
      path: item.path,
      size: item.size,
      mtimeMs: item.mtime ? item.mtime.getTime() : undefined,
    }));
  },
  unlink(path) {
    return RNFS.unlink(path);
  },
};

const writer = new RollingZipLogWriter({
  fs: rnfsLoggingAdapter,
  rootDir: `${RNFS.DocumentDirectoryPath}/applogs`,
  archivePrefix: "rabby-mobile-logs",
});

export const logger = new AppLogger({
  runtimeEnv: "production",
  platform: Platform.OS,
  writer,
  shouldWriteToFile: () => true,
  shouldCaptureConsole: () => true,
});

Host responsibilities

The host application must provide:

  • either a LoggingFileSystemAdapter for RollingZipLogWriter, or an AppLogWriter
  • its own app lifecycle integration
  • any platform-specific file sharing or export flow

Repository-only development notes live under packages/rabby-logger/docs/.