Javascript Package - Package Manager

About

This article talks about package manager in Javascript.

They are the first component of the web toolchain as they permit to:

  • declare package as dependency
  • download and update package
  • create a package of your code.

The Javascript ecosystem is based on the npm specification and relies on the package.json file as manifest to describe a package. Therefore every time, you see a package.json in a directory, this is the root directory of package

List

A non-exhaustive list of package manager

They have all their own implementation of node_modules directory that should contain all Javascript dependency

  • flat vs hierarchical
  • symlink

Create a directory by package manager and add a dependency to see the difference

pnpm add express
npm add express
pnpm add express

Lock-file

Every package manager creates a shrinkwrap file that should be committed in your version repository.

How to define it for your project?

You can define it with the packageManager property in package.json





Discover More
Javascript - (Shrinkwrap|lock) file

Depending on your package manager, the shrinkwrap file may be called: shrinkwrap.yaml, npm-shrinkwrap.json, package-lock.json, or yarn.lock. Some package managers use the term “lock file”,...
Javascript - Bouwer (Package manager)

Bouwer is a package manager. install git with the option bower/bower/wiki/Troubleshooting“Run Git from the Windows Command Prompt”. Bower is built on top of Git. install node.Js. It comes...
Javascript - Library

library in Javascript. A library is a distribution format as a package that is created from a module bundle from a prototype The difference between a package and a library is that the modules are...
Javascript - Toolchain (Build tools)

This page is building/shipping in the context of Javascript A JavaScript build toolchain typically consists of: A package manager to install and update package such as yarn, npm. A bundler (such...
Javascript - Yarn

Yarn is a package manager It aims to resolve two problems: to download the library only once by having a local repository to fix the code of the dependency. Library authors may have change the code...
Javascript - npm (Node package manager)

Npm is the package manager that is packaged/installed with a node installation. Automatically, with a node installation. Manually: -{VERSION}.tgz To update...
Javascript - pnpm

pnpm is a Javascript package manager pnpm differs from the other package manager via the structure of the node_modules folder where: the directory structure is flat with one dependency by directory...
Javascript Package - Dependency

package Dependency in Node. Dependency are declared/added in package.json: with a package manager or manually - dependency in the code used to build the dependency graph. - build and test...
Javascript Package - Package.json

Package.json is used by npm to store metadata for projects published as package. The package.json files: * serves as documentation for what packages your project depends on. * allows you to specify...
MonoRepo Manager - Lerna

Lerna is a wrapper around package manager that optimizes the workflow around publishing multi-package repositories with git and yarn It's not a full mono repository...



Share this page:
Follow us:
Task Runner