Skip to content

Automate converting npm projects to pnpm for improved speed and efficiency.

Notifications You must be signed in to change notification settings

wiselancer/npmtopnpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5269a51 Β· Sep 11, 2024

History

3 Commits
Sep 11, 2024
Sep 11, 2024
Sep 11, 2024

Repository files navigation

πŸš€ npm to pnpm Converter

This script automates the process of converting npm projects to pnpm within a specified directory.

πŸ“‹ Features

  • πŸ” Recursively searches for npm projects (identified by package-lock.json files)
  • πŸ”„ Converts npm projects to pnpm
  • πŸ“¦ Installs dependencies using pnpm
  • πŸ”™ Automatic rollback in case of failures
  • πŸ“Š Provides a summary of the conversion process

πŸ› οΈ Prerequisites

  • Bash shell
  • npm
  • pnpm

πŸš€ Usage

  1. Clone this repository:

    git clone https://github.com/yourusername/npm-to-pnpm-converter.git
    
  2. Navigate to the script directory:

    cd npm-to-pnpm-converter
    
  3. Make the script executable:

    chmod +x npmtopnpm.sh
    
  4. Run the script, specifying the target directory:

    ./npmtopnpm.sh /path/to/your/projects
    

πŸ“ Log File

The script generates a log file named pnpm_conversion.log in the current directory. This file contains detailed information about the conversion process.

🚨 Error Handling

If an error occurs during the conversion process for a project, the script will:

  • Log the error
  • Attempt to restore the project to its original state
  • Continue with the next project

πŸ“Š Summary

After processing all projects, the script provides a summary including:

  • Total number of projects processed
  • Number of successful conversions
  • Number of failed conversions

⚠️ Caution

Always backup your projects before running this script. While it includes rollback functionality, it's always better to have a separate backup.

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

πŸ“œ License

This project is MIT licensed.

About

Automate converting npm projects to pnpm for improved speed and efficiency.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages