Created
November 16, 2025 08:06
-
-
Save victory-sokolov/7614112e2be66b85ba19ceefe17ebd67 to your computer and use it in GitHub Desktop.
Get Node Package manager that project is using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get_node_package_manager() # Get Node package manager | |
| { | |
| if [[ -f bun.lockb ]]; then | |
| echo "bun" | |
| elif [[ -f pnpm-lock.yaml ]]; then | |
| echo "pnpm" | |
| elif [[ -f yarn.lock ]]; then | |
| echo "yarn" | |
| elif [[ -f package-lock.json ]]; then | |
| echo "npm" | |
| else | |
| echo "Package manager not found" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment