NPM

Bookmark this to keep an eye on new things I am learning.


NPM

Commands and packackes.

Return Home

Commands

  • npm init -y initialises a node project and auto answers all questions yes. (Omit -y to go through questions)
  • npm i will install any packages defined in the packages.json file
  • npm i packagename to install a package from npm.com
  • npm i packagename --save-dev to install a package as a development dependency only
  • npm uninstall packagename to uninstall a package
  • npm upgrade to update packages
  • npm install --production will 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

^ back to top ^

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

^ back to top ^