NPM
Commands and packackes.
Commands
npm init -yinitialises a node project and auto answers all questions yes. (Omit -y to go through questions)npm iwill install any packages defined in the packages.json filenpm i packagenameto install a package from npm.comnpm i packagename --save-devto install a package as a development dependency onlynpm uninstall packagenameto uninstall a packagenpm upgradeto update packagesnpm install --productionwill not install any dev dependencies, only production ones
The package.json file is updated with dependancies for installed packages, and their versions
You can add ^ and ~ before numbers to enforce update policies
^Allows minor and patch updates~Allows only patch updates
Useful NPM Packages
- Nodemon Automatically restarts the node application when file changes in the directory are detected.
- AXIOS Promise based HTTP client for the browser and node.js
- Crypto - Cryptography library (code to Node)
- Jest Javascript unit testing framework
- Express Web framework for Node.js
- Express-Validators server-side data validator
- Cors Middleware for Express which tells browsers which origins can read responses from your server
- Plex-API Plex API client
- Node-Ping Ping library for Node
- Image-size Get dimensions of any image file or buffer
- Pkg Package your Node.js project into an executable
- Awesome-Notifications JavaScript notifications library with enhanced async support
- Swagger Provides tools for designing and building Swagger-compliant APIs
- Chart.js JavaScript charting for designers & developers
- JSDoc An API documentation generator for JavaScript.
- Tree2Folder Create files and folders from a simple ASCII tree diagram