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

@bobfrankston/freezepak

v0.1.5

Published

Freeze/unfreeze node_modules — replace symlinks/junctions with real copies for portable deployment

Readme

freezepak

Freeze and unfreeze node_modules dependencies for portable deployment.

Problem

When you use local file: dependencies during development, npm creates symlinks (Linux/Mac) or junctions (Windows) in node_modules pointing back to the source directories. This is great for development — changes are reflected immediately — but these links break when you copy or deploy the project to another machine.

Solution

freezepak --freeze replaces every symlink/junction in node_modules with a real copy of the target directory. The project becomes fully self-contained and portable. It also adds a preinstall guard to package.json that blocks npm install from accidentally restoring the links and undoing the freeze.

freezepak --unfreeze removes the guard and runs npm install to restore normal linked dependencies.

Installation

npm install -g @bobfrankston/freezepak

CLI Usage

freezepak [path] --freeze      # Replace links with real copies
freezepak [path] --unfreeze    # Restore links via npm install
freezepak [path] --pack        # Freeze, pack to .tgz, then unfreeze
freezepak -v                   # Show version

The optional path argument specifies the project directory (defaults to the current directory).

Library Usage

freezepak can also be imported and used programmatically:

import { freezepak, freezeDependencies, unfreezeDependencies } from '@bobfrankston/freezepak';

// Freeze, create .tgz archive, then unfreeze — returns path to .tgz
const tgzPath: string = freezepak('/path/to/project');

// Freeze only (replace symlinks/junctions with real copies)
freezeDependencies('/path/to/project');

// Unfreeze only (remove guard, run npm install to restore links)
unfreezeDependencies('/path/to/project');

Idempotency

Both operations are idempotent — safe to run multiple times:

  • --freeze skips entries that are already real directories (not links). Running freeze twice on the same project just reports 0 frozen packages the second time. The preinstall guard is overwritten with the same value.

  • --unfreeze checks for the preinstall guard before acting. If there's no guard (already unfrozen), it reports "nothing to unfreeze" and exits without running npm install.

Reversibility

The dependencies field in package.json is never modified — your file: paths remain intact. This is what makes unfreeze possible: npm install reads those paths and recreates the links. The only package.json change is the preinstall guard in scripts, which unfreeze removes.

How it works

Freeze

  1. Walks node_modules (including @scope/ directories)
  2. For each entry, checks if it's a symlink or junction (comparing realpathSync to the entry path)
  3. If linked: removes the link, copies the real target directory in its place via fs.cpSync
  4. Saves any existing preinstall script as frozen-preinstall
  5. Sets preinstall to a guard that blocks npm install with an error message

Unfreeze

  1. Restores the original preinstall script (if one was saved as frozen-preinstall), or removes the guard entirely
  2. Runs npm install which reads the preserved file: paths in dependencies and recreates proper symlinks/junctions

License

MIT