local-pm
v1.0.3
Published
Local Package Manager - Install npm packages from your local system cache
Downloads
7
Maintainers
Readme
LocalPM (LPM) - The Offline-First Package Manager 🚀
LocalPM is a smart package manager that prioritizes installing npm packages from your local system cache before falling back to online sources. This can significantly speed up package installation and enable offline development when possible.
Features ✨
- 🔍 Scans your system for existing npm packages
- 📦 Reuses packages from your local cache
- 🌐 Falls back to online installation when needed
- ⚡ Faster installations by avoiding redundant downloads
- 🔄 Compatible with npm, yarn, and pnpm
- 💻 Cross-platform support (Windows, macOS, Linux)
Installation 🛠️
You can install LocalPM globally:
npm install -g lpmOr use it directly with npx:
npx lpm [packages...]Usage 📚
Basic Usage
# Install specific packages
lpm [email protected] react-dom
# Install all dependencies from package.json
lpm
# Install using a specific package manager
lpm express --package-manager yarn
# Install from a specific directory
lpm lodash --root-path /path/to/projectsCommand Line Options
Options:
--root-path, -r Custom root directory to scan for packages
--package-manager, -p Package manager to use (npm, yarn, pnpm) [default: "npm"]
--help Show help information
--version Show version numberHow It Works 🔄
- When you request to install a package, LocalPM first scans your system for existing installations
- If found in the local cache, it copies the package directly to your project
- If not found locally, it falls back to the specified package manager (npm/yarn/pnpm)
- Updates your package.json automatically with the installed dependencies
Benefits 💪
- Faster Installations: Reuse existing packages instead of downloading them again
- Offline Support: Install packages without internet if they exist in your local cache
- Bandwidth Saving: Minimize redundant downloads across projects
- Package Manager Agnostic: Works with npm, yarn, and pnpm
- Version Specific: Support for installing specific package versions
Requirements 📋
- Node.js >= 14.16
- npm, yarn, or pnpm installed globally
Common Use Cases 🎯
# Install multiple packages
lpm express mongoose dotenv
# Install specific versions
lpm [email protected] [email protected]
# Use with yarn
lpm --package-manager yarn next typescript
# Scan specific directory
lpm --root-path ~/projects expressTroubleshooting 🔧
- If a package isn't found locally, LocalPM will automatically fall back to online installation
- Use
--root-pathto specify a different directory to scan for packages - Make sure you have the necessary permissions to read the system directories
Contributing 🤝
Contributions are welcome! Please feel free to submit a Pull Request.
License 📄
MIT License - feel free to use this in your own projects!
Support 💬
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the documentation
- Submit a pull request with improvements
Acknowledgments 🙏
Thanks to all the contributors and the npm/yarn/pnpm teams for their amazing work!
