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

project-packer

v1.1.0

Published

Project packaging utility with build profiles

Readme

Project Packer

A utility for packaging projects with build profile support and file filtering.

Installation

npm install project-packer

Or install globally:

npm install -g project-packer

Usage

# From the project root
project-packer [profile] [options]

# Or run directly with node
node node_modules/.bin/project-packer [profile] [options]

Examples

# Pack with the default (development) profile
project-packer

# Pack with a production profile
project-packer production

# List available profiles
project-packer --list-profiles

# Override the output format
project-packer development --format zip

# Verbose output
project-packer production --verbose

# Specify a custom project root
project-packer production --project-root /path/to/project

Configuration

  • .packignore — global exclusion rules (similar to .gitignore)
  • pack-config.yaml — build profiles and additional settings

Build output is saved to the packed/ directory in the project root.

Features

1. Build Profiles

Create different packaging configurations for various scenarios (development, production, extensions).

2. Profile Inheritance

Profiles can inherit settings from other profiles via the base field, avoiding configuration duplication.

3. File Filtering

  • Global exclusions via .packignore
  • Profile exclusions via exclude_patterns
  • Forced inclusions via include_patterns (highest priority)

4. File Transformations

Modify files during packaging by executing JavaScript code. Useful for:

  • Removing dependencies from package.json
  • Replacing variables in configuration files
  • Renaming files

5. Symlink Resolution

Automatically copies real files instead of symlinks. Solves the problem with pnpm, where node_modules contain symbolic links to inaccessible files.

6. Execution Hooks

Run commands after packing (e.g., pnpm install, pnpm build). Useful for preparing deploy-ready applications.

7. Archive Options

  • Configurable compression level
  • Root folder creation inside the archive for convenient extraction

8. Progress and Debugging

  • Displays the currently processed directory
  • Verbose mode with logging of all operations
  • Error handling without interrupting the process

Configuration Example

.packignore

# Dependencies
**/node_modules/**

# Documentation
docs/**
**/*.md

# CI/CD and configuration
.gitlab-ci.yml
docker-compose.yml
.prettierrc.json

# Tests
**/*.test.*
**/*test*/**

pack-config.yaml

# General settings
output:
  base_dir: "packed"
  verbose: false

# Archive options
archive_options:
  compression_level: 9
  root_folder: "myapp"  # Creates a myapp/ folder inside the archive

# Build profiles
profiles:
  # Base production profile
  production-source:
    format: "folder"
    root_pattern: "./"
    exclude_patterns:
      - "app/src/lang/translations/**"
      - "packages/unused-driver"
      - "**/tests"
      - "**/docs"
    include_patterns:
      - "app/src/lang/translations/en-US.yaml"
    transformations:
      - pattern: "api/package.json"
        type: "json"
        operations:
          - 'delete $file.content.dependencies["some-unused-package"]'
          - '$file.content.version = "1.0.0"'

  # Inherits from production-source and adds build steps
  production-build:
    base: "production-source"
    format: "archive"
    exclude_patterns:
      - "**/scripts"
      - "**/dist"
    transformations:
      - pattern: "**/package.json"
        type: "json"
        operations:
          - 'delete $file.content.devDependencies'
    hooks:
      post_pack:
        - "pnpm install --frozen-lockfile"
        - "pnpm build"

  # Extensions only
  extensions:
    format: "folder"
    root_pattern: "./extensions"
    exclude_patterns:
      - "**/node_modules/**"
      - "**/dist/**"

  # Development profile
  development:
    format: "folder"
    root_pattern: "./"
    include_patterns:
      - "extensions/**"
    exclude_patterns:
      - "dist/**"

File Transformations

Transformations allow you to modify files during packaging:

transformations:
  - pattern: "api/package.json"
    type: "json"
    operations:
      # Remove a dependency
      - 'delete $file.content.dependencies["some-unused-package"]'
      # Change version
      - '$file.content.version = "1.0.0"'
      # Remove all dev dependencies
      - 'delete $file.content.devDependencies'

  - pattern: "**/*.env.example"
    type: "text"
    operations:
      # Replace text
      - '$file.content = $file.content.replace(/localhost:3000/g, "production.com")'
      # Rename the file
      - '$file.name = $file.name.replace(".example", "")'

The $file object contains:

  • $file.content — file content (object for JSON, string for other types)
  • $file.name — file name
  • $file.path — relative path to the file

Profile Inheritance

Profiles can inherit settings from each other:

profiles:
  base-production:
    format: "folder"
    exclude_patterns:
      - "**/tests/**"
      - "**/docs/**"

  production-api:
    base: "base-production"
    root_pattern: "./api"
    exclude_patterns:
      - "**/node_modules/**"  # Added to base exclusions

  production-full:
    base: "production-api"
    format: "archive"  # Overrides format
    hooks:
      post_pack:
        - "pnpm build"  # Added to parent hooks

Execution Hooks

Hooks allow you to run commands after packing:

profiles:
  production:
    format: "folder"
    hooks:
      post_pack:
        - "pnpm install --frozen-lockfile"
        - "pnpm build"
        - "docker build -t myapp ."

Hooks are executed in order, and command output is displayed in real-time in the console.