Getting Started with FNPM
Installation
First things first, let’s get FNPM installed on your system. It’s as easy as pie (and less messy)!
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ideascoldigital/fnpm/refs/heads/main/install.sh)"Project Setup
Once FNPM is installed, you can set it up in your project. This is where the magic begins! 🪄
Basic Setup
fnpm setupThis command will prompt you to choose your preferred package manager (npm, yarn, or pnpm). Don’t worry - your choice won’t affect your teammates. That’s the whole point!
Transparent Alias System (New!)
FNPM now includes a revolutionary transparent alias system that lets you use your favorite package manager commands while FNPM does the heavy lifting behind the scenes.
fnpm setup pnpmThis creates hooks that intercept pnpm commands and redirect them to FNPM. You can specify any supported package manager: npm, yarn, pnpm, or bun.
Shell Integration Setup
After running fnpm setup, you need to configure your shell to enable the transparent alias system:
# Add FNPM to your shell profile automaticallyecho 'eval "$(fnpm source)"' >> ~/.zshrc # For zsh usersecho 'eval "$(fnpm source)"' >> ~/.bashrc # For bash users
# Reload your shellsource ~/.zshrc # or ~/.bashrc# 1. Source the setup script in your current sessionsource .fnpm/setup.sh
# 2. Add to your shell profile manuallyecho 'eval "$(fnpm source)"' >> ~/.zshrc
# 3. Reload your shellexec $SHELL# For testing or one-time usesource .fnpm/setup.shVerify Installation
Once configured, test that the transparent aliases are working:
# These commands will now be intercepted by FNPMpnpm --helpnpm installyarn add lodash
# You should see a message like:# 🔄 This pnpm command is intercepted by FNPMBasic Commands
Installing Dependencies
To install all project dependencies:
fnpm installTo install a specific package:
fnpm install lodash# orfnpm add lodashRunning Scripts
To view all available scripts in your package.json:
fnpm runTo execute a specific script:
fnpm run <script-name># Example: fnpm run devAdding Dependencies
Add packages as dependencies with these commands:
fnpm add lodash express axiosfnpm add -D jest typescript @types/nodefnpm add -g typescript-language-serverRemoving Dependencies
To remove packages:
fnpm remove lodashHow It Works
FNPM creates a unified workflow by:
- Local Configuration: Creates a
.fnpmdirectory in your project to store user-specific settings - Lock File Management: Maintains consistent lock files regardless of which package manager is used
- Transparent Hook System: Intercepts package manager commands and redirects them to FNPM
- Shell Integration: Sets up aliases that make the transition seamless and invisible
The Magic Behind Transparent Aliases
When you run fnpm setup <package-manager>, FNPM creates:
- Hook scripts in
.fnpm/directory that intercept commands - Shell functions that override the original package manager commands
- Automatic detection of when you’re in an FNPM-managed project
- Fallback mechanisms to use original commands when needed
This means you can type pnpm install and FNPM will:
- Detect the command
- Map it to the appropriate FNPM operation
- Execute with FNPM’s optimized workflow
- Maintain your familiar CLI experience
Best Practices
For Teams
- Exclude
.fnpmfrom Version Control: Add.fnpmto your.gitignoreas it contains user-specific preferences - Commit Lock Files: Always commit the generated lock files to maintain dependency consistency
- Use CI/CD Integration: FNPM works seamlessly with CI/CD pipelines
For Developers
- Use Your Preferred Tool: Feel free to use your favorite package manager - FNPM handles the rest
- Trust the Process: Let FNPM manage lock files and dependency states
- Keep It Updated: Regularly update FNPM to get the latest features and improvements
Common Questions
Why does FNPM exist?
Because life’s too short for package manager drama! FNPM lets developers use their preferred tools while maintaining project consistency.
Will it affect my existing projects?
Nope! FNPM works alongside your existing package manager setup. It just makes everything play nice together.
What about my CI/CD pipeline?
FNPM works great with CI/CD! It ensures consistent builds regardless of which package manager is used in the pipeline.
Next Steps
Now that you’re up and running with FNPM, check out these resources:
- Shell Integration - Complete guide to transparent aliases and shell configuration
- Transparent Aliases Announcement - Learn about the latest features and improvements
- Advanced Usage - Learn about advanced features and configurations
- Team Integration - Best practices for team workflows
- CI/CD Setup - Setting up FNPM in your CI/CD pipeline
Welcome to the peaceful world of package management! 🕊️