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

@jun-a/local-filebrowser

v2.0.1

Published

Simple file browser web application built with Express.js

Readme

@jun-a/local-filebrowser

Simple local file browser web application with CLI support. Browse your files and preview content in a web interface.

Installation

Global Installation (Recommended)

npm install -g @jun-a/local-filebrowser

Local Installation

npm install @jun-a/local-filebrowser

Usage

CLI Commands

After global installation, you can use either command:

Short command (lfb):

# Start file browser on default port (3099)
lfb

# Start on specific port
lfb -p 8080

# Browse specific directory
lfb -d ~/Documents

# Combine options
lfb -p 8080 -d ~/Downloads

Full command (local-file-browser):

# Start file browser on default port (3099)
local-file-browser

# Start on specific port
local-file-browser -p 8080

# Browse specific directory
local-file-browser -d ~/Documents

# Combine options
local-file-browser -p 8080 -d ~/Downloads

CLI Options

  • -p, --port <number>: Port number (default: 3099)
  • -d, --path <path>: Directory path to browse (default: current directory)
  • -h, --help: Show help message
  • -v, --version: Show version number

Programmatic Usage

const path = require('path');
const { spawn } = require('child_process');

// Set environment variables
process.env.PORT = '8080';
process.env.DATA_PATH = path.resolve('./my-directory');

// Start server
require('@jun-a/local-filebrowser');

Manual Installation

git clone <repository-url>
cd local-filebrowser
npm install
npm start

Features

  • Directory browsing: View files and folders in any directory
  • File preview: Support for multiple file types
    • Markdown (.md): Rendered HTML display
    • Code files (.js, .css, .html, .py, .java, .cpp, etc.): Syntax highlighting
    • Text files (.txt): Plain text display
    • Images (.png, .jpg, .gif, etc.): Image display
  • Breadcrumb navigation: Easy navigation through directory hierarchy
  • Responsive design: Mobile-friendly interface
  • Security: Path traversal protection and file size limits

Environment Variables

  • PORT: Server port (default: 3099)
  • DATA_PATH: Base directory path (default: current working directory)

Web Interface

  1. Open your browser and go to http://localhost:3099 (or your specified port)
  2. Enter a directory path in the input field
  3. Click "Browse" or press Enter
  4. Click on files to preview them
  5. Click on folders to navigate into them

API Endpoints

GET /api/browse

  • Parameter: path (directory path)
  • Response: List of files and folders

GET /api/preview

  • Parameter: path (file path)
  • Response: File content and type information

GET /api/file

  • Parameter: path (file path)
  • Response: Raw file data

Security Features

  • File size limit (1MB for preview)
  • Path traversal protection
  • Proper MIME type handling
  • Error handling and validation

Technology Stack

  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • Backend: Node.js, Express.js
  • Markdown processing: marked.js
  • Syntax highlighting: highlight.js
  • MIME type handling: mime-types

File Structure

@jun-a/local-filebrowser/
├── bin/
│   └── lfb.js           # CLI executable
├── public/
│   ├── css/
│   │   └── styles.css
│   └── js/
│       └── app.js
├── views/
│   └── index.html
├── server.js            # Main server file
├── package.json
└── README.md

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

ISC License

Changelog

v1.0.0

  • Initial release
  • CLI support with lfb command
  • File browsing and preview functionality
  • Responsive web interface