Last Updated on January 13, 2024 by Neil Murray
NPM commands #
- npm install – installs all npm packages defined in package.json file
- npm outdated – lists all npm packages that are out of date on local install
- npm update – updates all npm packages that are out of date
- npm start – gives access to current Javascript development at http://localhost:3000. Any changes are reloaded automatically
- npm run develop – rebuilds CF7 Skins plugins in wp-admin (includes unminified code & map files which makes debugging easier)
- npm run build – use for production builds of CF7 Skins plugins (includes minification for wordpress.org etc.)
Delete node_modules #
You may need to follow this procedure after each major change e.g. switching to a different branch:
- Delete node_modules folder – removes package.json setup for previous branch
- npm install or yarn install – installs current package.json setup
Tip: This ensures the build process matches with the process defined on the current branch.
Avoid adding node_modules folder to Trash #
To avoid adding the node_modules folder to Trash (which can become very large with repeated deletions) select the node_modules folder then press Shift + Delete keyboard combination. Your selected folders/files will be permanently deleted without going to Recycle Bin.
Update Node.js and npm on Windows #
To update Node.js and npm you can just download and run the latest MSI. The MSI will update your installed node and npm.
You can also use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.
- nvm (macOS/Linux)
- nvm-windows (Windows)
- Chocolatey (Windows)
Windows command line commands #
- clear – clears command line interface
- Ctrl + c – exits running npm command
- Ctrl + Shift + r – reloads a website page ignoring local browser cache
- Ctrl + Shift + del – brings up the cache control from preferences (Chrome)
- exit – shuts down command line interface
Tip: See How to Clear the Cache in Google Chrome.
Regular Expressions #
- regex101.com – build regular expressions
Further reading:
Notes:
ADD notes here.
Save all Images to Sync – use ..\Sync\..\ADD FOLDER