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

moblog

v1.0.0

Published

Lightweight mobile browser debug console

Readme

moblog

Lightweight mobile browser debug console. ~8KB gzipped.

Features

  • Captures all console.log/info/warn/error/debug calls
  • Captures uncaught errors and unhandled promise rejections
  • Floating overlay with FAB minimize button
  • Filter logs by level (LOG, INFO, WARN, ERROR, DEBUG)
  • Search/filter logs by text
  • Copy logs to clipboard
  • Export logs as TXT or JSON
  • Persists logs across page refreshes (sessionStorage)
  • Zero dependencies
  • Mobile-friendly touch targets

Installation

npm install moblog

Or via CDN:

<script src="https://unpkg.com/moblog"></script>

Quick Start

import Mlog from 'moblog';

// Initialize with defaults
Mlog.init();

// Now all console.log calls will appear in the floating panel
console.log('Hello mlog!');

Or with a script tag:

<script src="https://unpkg.com/moblog"></script>
<script>
  Mlog.init();
</script>

Configuration

import Mlog from 'moblog';

const mlog = new Mlog({
  // Display options
  maxLines: 200,              // Max log lines to keep
  startMinimized: true,       // Start as FAB button
  position: 'bottom-right',   // FAB position (future)
  theme: 'dark',              // Theme (future)

  // Capture options
  captureConsole: true,       // Capture console.log/warn/error
  captureErrors: true,        // Capture window.onerror
  capturePromiseRejections: true,  // Capture unhandledrejection

  // Persistence
  persist: true,              // Save logs to sessionStorage
  storageKey: 'mlog-logs',    // Storage key

  // Callbacks
  onLog: (entry) => {},       // Called on each log
  onError: (error) => {},     // Called on errors
});

API

// Static initialization (singleton)
const mlog = Mlog.init(options);

// Or create instance directly
const mlog = new Mlog(options);

// Add custom log
mlog.log('Custom message', 'info');

// Control visibility
mlog.show();
mlog.hide();
mlog.toggle();

// Clear all logs
mlog.clear();

// Copy logs to clipboard
mlog.copy();

// Export logs
mlog.export('txt');   // Download as .txt
mlog.export('json');  // Download as .json

// Cleanup
mlog.destroy();
Mlog.destroy();  // Static method for singleton

Disable via Query Param

Add ?mlog=false to the URL to completely disable mlog:

https://myapp.com/page?mlog=false

When disabled, Mlog.init() returns a no-op instance so your code won't break.

Gestures & Shortcuts

  • Double-tap anywhere on the page to toggle the panel
  • Escape key to minimize
  • Click the FAB button to expand

Framework Integration

Initialize mlog as early as possible to capture all console output. The best location depends on your stack:

Rails (with importmaps or esbuild)

// app/javascript/application.js (top of file)
import Mlog from 'moblog';
Mlog.init();

// ... rest of your imports

Rails (Stimulus)

// app/javascript/controllers/application.js
import { Application } from "@hotwired/stimulus";
import Mlog from 'moblog';

Mlog.init();

const application = Application.start();

React / Next.js

// src/index.js or pages/_app.js (top of file)
import Mlog from 'moblog';
Mlog.init();

// ... rest of imports

Vue

// src/main.js (top of file)
import Mlog from 'moblog';
Mlog.init();

import { createApp } from 'vue';
// ...

Vanilla HTML

<!-- In <head>, before other scripts -->
<script src="https://unpkg.com/moblog"></script>
<script>Mlog.init();</script>

Conditional Loading (Production only, dev only, etc.)

// Only in development
if (process.env.NODE_ENV === 'development') {
  import('moblog').then(({ default: Mlog }) => Mlog.init());
}

// Only in production (for field debugging)
if (process.env.NODE_ENV === 'production') {
  import('moblog').then(({ default: Mlog }) => Mlog.init());
}

// Only on mobile devices
if (/iPhone|iPad|Android/i.test(navigator.userAgent)) {
  import('moblog').then(({ default: Mlog }) => Mlog.init());
}

Use Cases

  • Debug JavaScript issues on mobile devices without DevTools
  • Capture errors from users in the field
  • Debug PWAs and service workers on mobile
  • Quick debugging on devices where connecting DevTools is difficult

Development

npm install       # Install dependencies
npm run build     # Build all bundles
npm run dev       # Watch mode
npm test          # Run tests

Comparison

| Library | Size | Features | |---------|------|----------| | vConsole | 50KB | Full devtools | | Eruda | 100KB+ | Full devtools | | debug | 3KB | Logging only, no UI | | moblog | ~8KB | Console + Errors + UI |

License

MIT