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! 🪄
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!
Basic 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
- Shell Integration: Sets up helpful aliases to prevent accidental use of direct package manager commands
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:
- 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! 🕊️