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

file-mover

v0.4.5

Published

Script to move files and update imports automatically

Readme

File Mover Refactor Tool

A CLI tool to move files and automatically update all relevant import statements in a monorepo or multi-package TypeScript/JavaScript project.


Features

  • Move one or more files to new locations.
  • Automatically updates all import paths in the codebase that reference the moved files.
  • Updates relative and @ms/-style imports.
  • Handles both TypeScript and JavaScript files.
  • Supports dry-run and verbose modes for safe and transparent refactoring.

Installation

Clone this repository and install dependencies:

npm install

Usage

Move Files

Prepare a move.json file in the root directory, containing an array of [from, to] path pairs:

[
  [
    "C:/path/to/source/file1.ts",
    "C:/path/to/destination/file1.ts"
  ],
  [
    "C:/path/to/source/file2.ts",
    "C:/path/to/destination/file2.ts"
  ]
]

Then run:

npx ts-node move-file.ts

Or, if you have built the project:

node move-file.js

Options

  • --dry-run
    Show what would be changed, but do not actually move files or update imports.

  • --verbose
    Print detailed information about every import update.


How It Works

  1. Reads the list of file moves from move.json.
  2. Validates that all source files exist and destination files do not.
  3. Finds all source files in the workspace (excluding node_modules, dist, etc.).
  4. Analyzes which files import the files to be moved.
  5. Moves the files.
  6. Updates all relevant import statements in the codebase and inside the moved files themselves.

Configuration

The tool is configured to work with a monorepo structure, specifically looking for files in:

  • packages/powerva-main
  • packages/powerva-embedded-experiences
  • packages/powerva-core
  • apps/powerva-microsoft-com

You can adjust these in move-file.ts if your project structure is different.


Scripts

  • npm run move — Run the move tool.
  • npm run test-move — Run in dry-run mode.
  • npm run start — Run the built tool with increased memory.
  • npm run startv — Run the built tool in verbose mode.

TypeScript

The project is written in TypeScript. See tsconfig.json for compiler options.


Dependencies

  • @babel/parser and @babel/traverse — For parsing and traversing code to find and update import statements.
  • fast-glob — For fast file searching.
  • glob — For pattern-based file matching.

Example

Suppose you want to move:

  • packages/powerva-main/src/pages/adaptive-authoring/AdaptiveAuthoringIcons.tsx
    to
    packages/powerva-main/src/common/icons/AdaptiveAuthoringIcons.tsx

Add this pair to move.json and run the tool. All imports of AdaptiveAuthoringIcons will be updated across the codebase.


Development

Project Structure

  • move-file.ts — Main CLI entry point.
  • src/types.ts — TypeScript types and interfaces.
  • src/pathUtils.ts — Path normalization and import path helpers.
  • src/importUtils.ts — Import analysis and statement finding.
  • src/fileOps.ts — File moving and import updating logic.

ppux workflow process

  1. install the

package.json command: "file-mover": "node node_modules/file-mover/dist/index.js exmaple.json && echo 'File move completed successfully!' && rush lint -o powerva-main -o powerva-core -o powerva-microsoft-com -o powerva-embedded-experiences --fix"


Known issues and TODO:

  1. Use relative path(?)
  2. Current it doesn't support moving files from apps -> package due to it's imposable (We could but it'd mean more file scanning) to import app files from package and update file path from dist import to it's original export

License

MIT