08 - Use the Tilde to Use the Latest Patch - Managing Packages with npm - freeCodeCamp Tutorial
Ganesh H
In most use cases, you don’t want to miss bug fixes since they often include important security patches. To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (~) character.
Link to challenge : https://www.freecodecamp.org/learn/apis-and-microservices/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency Written Guide : https://www.notion.so/ganeshh123/Use-the-Tilde-Character-to-Always-Use-the-Latest-Patch-Version-of-a-Dependency-7942e8c8890949588c46badeb2e04d71
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1RO7qDtCW9Cn9FyRJ1Dk6xk All Writen Guides for this course : https://www.notion.so/ganeshh123/4d5e59dbe72940aeb68fe6f38ebf28e1 All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
Concepts: Tilde Ranges Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not. https://docs.npmjs.com/misc/semver#tilde-ranges-123-12-1
Semantic Versioning Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes. https://semver.org/
package.json All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. It can also contain other metadata such as a project description, the version of the project in a particular distribution, license information, even configuration data - all of which can be vital to both npm and to the end users of the package. The package.json file is normally located at the root directory of a Node.js project. https://nodejs.org/en/knowledge/getting-started/npm/what-is-the-file-package-json/ -————————————————————————————————————- The Node Package Manager (npm) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they compl ... https://www.youtube.com/watch?v=XAo2BTPzFow
6388192 Bytes