Skip to content

Commit

Permalink
feat: Add npm commands for updating, listing outdated packages, runni…
Browse files Browse the repository at this point in the history
…ng security audit, and cleaning cache
  • Loading branch information
valter-silva-au committed Mar 7, 2024
1 parent 3cb5d2a commit cf377fc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/make/npm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ npm/version:
@npm --version

.PHONY: npm/install-global
# Set npm global for current user
npm/install-global:
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
Expand All @@ -18,3 +19,23 @@ npm/install-global:
npm/update-path:
echo 'export PATH=~/.npm-global/bin:$$PATH' >> ~/.bashrc
source ~/.bashrc

.PHONY: npm/update
## Update packages to the latest version
npm/update:
npm update

.PHONY: npm/outdated
## List outdated packages
npm/outdated:
npm outdated

.PHONY: npm/audit
## Run security audit
npm/audit:
npm audit

.PHONY: npm/clean-cache
## Clean npm cache
npm/clean-cache:
npm cache clean --force

0 comments on commit cf377fc

Please sign in to comment.